Add an option to set the MP3 bitrate when converting (fixes #113)

This commit is contained in:
Pierre Rudloff 2017-11-10 23:50:17 +01:00
parent 627108e08d
commit fd2a4d8745
4 changed files with 12 additions and 0 deletions

View file

@ -82,6 +82,13 @@ class Config
*/
public $remux = false;
/**
* MP3 bitrate when converting (in kbit/s)
*
* @var int
*/
public $audioBitrate = 128;
/**
* YAML config file path.
*

View file

@ -281,6 +281,7 @@ class VideoDownload
'-user-agent', $this->getProp(null, null, 'dump-user-agent'),
'-i', $url,
'-f', 'mp3',
'-b:a', $this->config->audioBitrate.'k',
'-vn',
'pipe:1',
]

View file

@ -26,3 +26,6 @@ uglyUrls: false
# True to stream videos through server
stream: false
# MP3 bitrate when converting (in kbit/s)
audioBitrate: 128

View file

@ -67,6 +67,7 @@ class ConfigTest extends TestCase
$this->assertInternalType('bool', $config->uglyUrls);
$this->assertInternalType('bool', $config->stream);
$this->assertInternalType('bool', $config->remux);
$this->assertInternalType('int', $config->audioBitrate);
}
/**