From 959b141282786d4cf46556e2d549e8b4a5281812 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 9 Dec 2017 23:16:48 +0100 Subject: [PATCH] Add a setting that controls ffmpeg verbosity Don't display ffmpeg errors in tests --- classes/Config.php | 8 ++++++++ classes/VideoDownload.php | 2 +- config/config.example.yml | 3 +++ config/config_test.yml | 1 + config/config_test_windows.yml | 1 + 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/classes/Config.php b/classes/Config.php index 513202a..65dd62d 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -89,6 +89,14 @@ class Config */ public $audioBitrate = 128; + /** + * avconv/ffmpeg logging level. + * Must be one of these: quiet, panic, fatal, error, warning, info, verbose, debug + * + * @var string + */ + public $avconvVerbosity = 'error'; + /** * YAML config file path. * diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index 26ac1f9..7480d8b 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -276,7 +276,7 @@ class VideoDownload $builder = ProcessBuilder::create( [ $this->config->avconv, - '-v', 'error', + '-v', $this->config->avconvVerbosity, //Vimeo needs a correct user-agent '-user_agent', $this->getProp(null, null, 'dump-user-agent'), '-i', $url, diff --git a/config/config.example.yml b/config/config.example.yml index 2740303..4b25bcd 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -18,6 +18,9 @@ convert: false # Path to your avconv or ffmpeg binary avconv: vendor/bin/ffmpeg +# avconv/ffmpeg logging level. +avconvVerbosity: error + # Path to your rtmpdump binary rtmpdump: vendor/bin/rtmpdump diff --git a/config/config_test.yml b/config/config_test.yml index 8968c0f..99b704b 100644 --- a/config/config_test.yml +++ b/config/config_test.yml @@ -1,2 +1,3 @@ --- convert: false +avconvVerbosity: fatal diff --git a/config/config_test_windows.yml b/config/config_test_windows.yml index 29a7740..78f24df 100644 --- a/config/config_test_windows.yml +++ b/config/config_test_windows.yml @@ -2,6 +2,7 @@ convert: false python: C:\Python36\python.exe avconv: C:\ProgramData\chocolatey\bin\ffmpeg.exe +avconvVerbosity: fatal rtmpdump: C:\ProgramData\chocolatey\bin\rtmpdump youtubedl: C:\Python36\Lib\site-packages\youtube_dl\__main__.py params: