smellslikeml commited on
Commit
b3a923c
·
1 Parent(s): b584fdf

initial commit

Browse files
Files changed (1) hide show
  1. video_stabilizer.py +6 -6
video_stabilizer.py CHANGED
@@ -8,20 +8,20 @@ class VideoStabilizationTool(Tool):
8
  Inputs are input_path, output_path, smoothing, zoom.
9
  Output is the output_path.
10
  """
11
- inputs = ["text", "text", "integer", "integer", "integer"]
12
  outputs = ["text"]
13
 
14
  def __call__(
15
  self,
16
  input_path: str,
17
  output_path: str,
18
- smoothing: int = 10,
19
- zoom: int = 0,
20
- shakiness: int = 5,
21
  ):
22
  (
23
  ffmpeg.input(input_path)
24
- .output("null", vf="vidstabdetect=shakiness={}".format(shakiness), f="null")
25
  .overwrite_output()
26
  .run(capture_stdout=True, capture_stderr=True)
27
  )
@@ -30,7 +30,7 @@ class VideoStabilizationTool(Tool):
30
  .output(
31
  output_path,
32
  vf="vidstabtransform=smoothing={}:zoom={}:input={}".format(
33
- smoothing, zoom, "transforms.trf"
34
  ),
35
  )
36
  .overwrite_output()
 
8
  Inputs are input_path, output_path, smoothing, zoom.
9
  Output is the output_path.
10
  """
11
+ inputs = ["text", "text", "text", "text", "text"]
12
  outputs = ["text"]
13
 
14
  def __call__(
15
  self,
16
  input_path: str,
17
  output_path: str,
18
+ smoothing: str = "10",
19
+ zoom: str = "0",
20
+ shakiness: str = "5",
21
  ):
22
  (
23
  ffmpeg.input(input_path)
24
+ .output("null", vf="vidstabdetect=shakiness={}".format(int(shakiness)), f="null")
25
  .overwrite_output()
26
  .run(capture_stdout=True, capture_stderr=True)
27
  )
 
30
  .output(
31
  output_path,
32
  vf="vidstabtransform=smoothing={}:zoom={}:input={}".format(
33
+ int(smoothing), int(zoom), "transforms.trf"
34
  ),
35
  )
36
  .overwrite_output()