-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathffmpeg-video.php
75 lines (54 loc) · 1.25 KB
/
ffmpeg-video.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
71
72
73
74
75
<?php
require_once("ffmpeg-parameter.php");
class ffmpeg_video {
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 rate($rate) {
$this->add_attrib("r",$rate);
}
public function encoding($fmt) {
$this->add_attrib("c:v",$fmt);
}
public function group_of_picture($int) {
$this->add_attrib("g",$int);
}
public function qscale($int = 0) {
$this->add_attrib("q:v",$int);
}
public function disable() {
$this->add_attrib("vn");
}
public function copy() {
$this->encoding("copy");
}
public function bitrate($bitrate) {
$this->add_attrib("b:v",$bitrate);
}
public function start_time($time) {
$this->add_attrib("ss",$time);
}
public function length($length) {
$this->add_attrib("t",$length);
}
public function format($format) {
$this->add_attrib("f",$format);
}
public function clear_metadata() {
$this->add_attrib("map_metadata","-1");
}
}
?>