-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathtest.py
More file actions
28 lines (25 loc) · 691 Bytes
/
test.py
File metadata and controls
28 lines (25 loc) · 691 Bytes
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
from better_ffmpeg_progress import FfmpegProcess, FfmpegProcessError
command = [
"ffmpeg",
"-i",
"https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
"-c:v",
"libx264",
"-preset",
"ultrafast",
"-c:a",
"copy",
"-f",
"null",
"-",
]
try:
process = FfmpegProcess(command)
# Uncomment the line below if you want to use tqdm instead of rich for the progress bar
# process.use_tqdm = True
process.run()
# The FFmpeg process failed
if process.return_code != 0:
pass
except FfmpegProcessError as e:
print(f"An error occurred when running the better-ffmpeg-process package:\n{e}")