-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
47 lines (41 loc) · 1.15 KB
/
index.php
File metadata and controls
47 lines (41 loc) · 1.15 KB
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
<?php
require_once __DIR__.'/vendor/autoload.php';
use FFMpeg\Exceptions\CancelProcessException;
use FFMpeg\FFMpeg;
$ffmpeg = new FFMpeg();
$ffmpeg
->params(["-y"])
->input("/Users/owenandrews/Desktop/ffmpeg-testing/input.mp4")
->params([
"-sn", "-dn",
"-ss", "15",
"-t", "10"
])
->input("/Users/owenandrews/Desktop/ffmpeg-testing/input-2.mp4")
->params(["-sn", "-dn"])
->output("/Users/owenandrews/Desktop/ffmpeg-testing/output/out-1.mp4")
->params([
"-vf", "scale=720:-2",
"-map", "0:v"
])
->output("/Users/owenandrews/Desktop/ffmpeg-testing/output/out-2.mp4")
->params([
"-vf", "scale=720:-2",
"-map", "1:v"
])
->output("/Users/owenandrews/Desktop/ffmpeg-testing/output/poster.jpg")
->params([
"-vf", "scale=200:-2",
"-frames:v", "1",
"-ss", "00:01",
"-pix_fmt", "yuv420p",
"-c:v", "libopenjpeg"
]);
//echo(join(' ', $ffmpeg->buildCommand()));
$ffmpeg->progress(function ($progress) {
echo($progress.'%'.PHP_EOL);
if ($progress > 50) {
//throw new CancelProcessException();
}
});
$ffmpeg->run();