Add an option to set the MP3 bitrate when converting (fixes #113)
This commit is contained in:
parent
627108e08d
commit
fd2a4d8745
4 changed files with 12 additions and 0 deletions
|
@ -82,6 +82,13 @@ class Config
|
||||||
*/
|
*/
|
||||||
public $remux = false;
|
public $remux = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MP3 bitrate when converting (in kbit/s)
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $audioBitrate = 128;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* YAML config file path.
|
* YAML config file path.
|
||||||
*
|
*
|
||||||
|
|
|
@ -281,6 +281,7 @@ class VideoDownload
|
||||||
'-user-agent', $this->getProp(null, null, 'dump-user-agent'),
|
'-user-agent', $this->getProp(null, null, 'dump-user-agent'),
|
||||||
'-i', $url,
|
'-i', $url,
|
||||||
'-f', 'mp3',
|
'-f', 'mp3',
|
||||||
|
'-b:a', $this->config->audioBitrate.'k',
|
||||||
'-vn',
|
'-vn',
|
||||||
'pipe:1',
|
'pipe:1',
|
||||||
]
|
]
|
||||||
|
|
|
@ -26,3 +26,6 @@ uglyUrls: false
|
||||||
|
|
||||||
# True to stream videos through server
|
# True to stream videos through server
|
||||||
stream: false
|
stream: false
|
||||||
|
|
||||||
|
# MP3 bitrate when converting (in kbit/s)
|
||||||
|
audioBitrate: 128
|
||||||
|
|
|
@ -67,6 +67,7 @@ class ConfigTest extends TestCase
|
||||||
$this->assertInternalType('bool', $config->uglyUrls);
|
$this->assertInternalType('bool', $config->uglyUrls);
|
||||||
$this->assertInternalType('bool', $config->stream);
|
$this->assertInternalType('bool', $config->stream);
|
||||||
$this->assertInternalType('bool', $config->remux);
|
$this->assertInternalType('bool', $config->remux);
|
||||||
|
$this->assertInternalType('int', $config->audioBitrate);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue