-
Notifications
You must be signed in to change notification settings - Fork 3
/
ffmpeg-audio.php
70 lines (51 loc) · 1.18 KB
/
ffmpeg-audio.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
require_once("ffmpeg-parameter.php");
class ffmpeg_audio {
public $ffmpeg_wrapper;
public $attribs;
public function __construct($wrapper) {
$this->ffmpeg_wrapper = $wrapper;
$this->attribs = array();
}
public function add_attrib($param, $value = "") {
array_push($this->attribs, new ffmpeg_parameter($param,$value));
}
public function get_string() {
$str = "";
foreach ($this->attribs as $param) {
$str .= $param->get_string() . " ";
}
return $str;
}
public function encoding($fmt) {
$this->add_attrib("c:a",$fmt);
}
public function qscale($int = 0) {
$this->add_attrib("q:a",$int);
}
public function disable() {
$this->add_attrib("an");
}
public function copy() {
$this->encoding("copy");
}
public function sample_rate($rate) {
$this->add_attrib("ar",$rate);
}
public function channels($chan) {
$this->add_attrib("ac",$chan);
}
public function quality($quality) {
$this->add_attrib("aq",$quality);
}
public function bitrate($bitrate) {
$this->add_attrib("b:a",$bitrate);
}
public function start_time($time) {
$this->add_attrib("ss",$time);
}
public function length($length) {
$this->add_attrib("t",$length);
}
}
?>