You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/ffmpegio/transcode.py
+36-8Lines changed: 36 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,10 @@
1
+
fromosimportpath
2
+
1
3
from . importffmpeg
2
4
from . importprobe
3
5
4
6
5
-
deftranscode_sync(
7
+
deftranscode(
6
8
input_url,
7
9
output_url,
8
10
start=None,
@@ -18,6 +20,7 @@ def transcode_sync(
18
20
video_crf=None,
19
21
video_pix_fmt=None,
20
22
video_filter=None,
23
+
force=None,
21
24
input_options=None,
22
25
output_options=None,
23
26
global_options=None,
@@ -26,7 +29,7 @@ def transcode_sync(
26
29
27
30
https://ffmpeg.org/ffmpeg.html
28
31
29
-
:param input_url: url/path of the input media file
32
+
:param input_url: url/path of the input media file
30
33
:type input_url: str
31
34
:param output_url: url/path of the output media file
32
35
:type output_url: str
@@ -57,6 +60,8 @@ def transcode_sync(
57
60
:param video_filter: filtergraph definition for filtering video streams, defaults to None
58
61
:type video_filter: str, optional
59
62
:param input_options: dict of user-defined input options, defaults to None. each key is FFmpeg option argument without leading '-' with trailing stream specifier if needed. For flag options, set their values to None.
63
+
:param force: True to overwrite if file exists or False to skip. If None or
64
+
unspecified, FFmpeg will ask for resolution.
60
65
:type input_options: dict, optional
61
66
:param output_options: dict of user-defined output options, defaults to None. each key is FFmpeg option argument without leading '-' with trailing stream specifier if needed. For flag options, set their values to None.
62
67
:type output_options: dict, optional
@@ -66,15 +71,15 @@ def transcode_sync(
66
71
:rtype: int
67
72
68
73
notes:
69
-
74
+
70
75
`start` vs `end` vs `duration` - Only 2 out of 3 are honored.
0 commit comments