mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-12 10:55:57 +08:00
Check ffmpeg before rendering video (#715)
* check ffmpeg before rendering video * Fix imports
This commit is contained in:
1 parent
ec23b402a5
commit
9252a46273
3 files changed
+47
-22
No files matched your search
+3
-22
@@ -16,7 +16,7 @@ import tyro
|
||||
from rich.console import Console
|
||||
from rich.progress import track
|
||||
|
||||
from nerfstudio.utils import colmap_utils
|
||||
from nerfstudio.utils import colmap_utils, install_checks
|
||||
|
||||
CONSOLE = Console(width=120)
|
||||
|
||||
@@ -34,25 +34,6 @@ CAMERA_MODELS = {
|
||||
}
|
||||
|
||||
|
||||
def check_ffmpeg_installed():
|
||||
"""Checks if ffmpeg is installed."""
|
||||
ffmpeg_path = shutil.which("ffmpeg")
|
||||
if ffmpeg_path is None:
|
||||
CONSOLE.print("[bold red]Could not find ffmpeg. Please install ffmpeg.")
|
||||
print("See https://ffmpeg.org/download.html for installation instructions.")
|
||||
print("ffmpeg is only necissary if using videos as input.")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def check_colmap_installed():
|
||||
"""Checks if colmap is installed."""
|
||||
colmap_path = shutil.which("colmap")
|
||||
if colmap_path is None:
|
||||
CONSOLE.print("[bold red]Could not find COLMAP. Please install COLMAP.")
|
||||
print("See https://colmap.github.io/install.html for installation instructions.")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def get_colmap_version(default_version=3.8) -> float:
|
||||
"""Returns the version of COLMAP.
|
||||
This code assumes that colmap returns a version string of the form
|
||||
@@ -408,8 +389,8 @@ def main(
|
||||
verbose: If True, print extra logging.
|
||||
"""
|
||||
|
||||
check_ffmpeg_installed()
|
||||
check_colmap_installed()
|
||||
install_checks.check_ffmpeg_installed()
|
||||
install_checks.check_colmap_installed()
|
||||
|
||||
output_dir.mkdir(parents=True, exist_ok=True)
|
||||
image_dir = output_dir / "images"
|
||||
|
||||
Reference in new issue
Block a user