Skip to content

Open-Sora: Democratizing Efficient Video Production for All

Python

[feat] fps control

zhengzangwc93e84601726
diff --git a/configs/opensora-v1-2/inference/sample.py b/configs/opensora-v1-2/inference/sample.py
index db913b8..fd04d23 100644
--- a/configs/opensora-v1-2/inference/sample.py
+++ b/configs/opensora-v1-2/inference/sample.py
@@ -3,6 +3,7 @@ aspect_ratio = "9:16"
num_frames = 51
fps = 24
frame_interval = 1
+save_fps = 24
prompt_path = "./assets/texts/t2v_sora.txt"
# == Uncomment the following line to use the prompt below ==
diff --git a/opensora/utils/config_utils.py b/opensora/utils/config_utils.py
index 51a0382..ecac612 100644
--- a/opensora/utils/config_utils.py
+++ b/opensora/utils/config_utils.py
@@ -50,6 +50,7 @@ def parse_args(training=False):
# image/video
parser.add_argument("--num-frames", default=None, type=str, help="number of frames")
parser.add_argument("--fps", default=None, type=int, help="fps")
+ parser.add_argument("--save-fps", default=None, type=int, help="save fps")
parser.add_argument("--image-size", default=None, type=int, nargs=2, help="image size")
parser.add_argument("--frame-interval", default=None, type=int, help="frame interval")
parser.add_argument("--aspect-ratio", default=None, type=str, help="aspect ratio (h:w)")
diff --git a/scripts/inference.py b/scripts/inference.py
index 9dc1a7d..1461198 100644
--- a/scripts/inference.py
+++ b/scripts/inference.py
@@ -122,7 +122,7 @@ def main():
# == prepare arguments ==
fps = cfg.fps
- save_fps = fps // cfg.get("frame_interval", 1)
+ save_fps = cfg.get("save_fps", fps // cfg.get("frame_interval", 1))
multi_resolution = cfg.get("multi_resolution", None)
batch_size = cfg.get("batch_size", 1)
num_sample = cfg.get("num_sample", 1)