Skip to content

Commit

Permalink
Replaced 'moviepy' with 'ffmpeg' for video generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahul-JOON committed Feb 24, 2023
1 parent cab9ea9 commit 253c057
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from multiprocessing import Pool

import numpy as np
from moviepy.editor import ImageSequenceClip
from scipy import interpolate
from tqdm import tqdm

Expand Down Expand Up @@ -176,15 +175,10 @@
)
pbar.update()

# Create Video using moviepy
# Create Video using ffmpeg
for view_name in stage_scripts.keys():
imageset_path = os.path.join(OUTPUT_IMAGES_DIR, view_name)
imageset = [
os.path.join(imageset_path, path)
for path in os.listdir(imageset_path)
if path[-3:] == "png"
]
imageset.sort()

filename = OUTPUT_FILENAME + "_" + view_name + ".mp4"
clip = ImageSequenceClip(imageset, fps=FPS)
clip.write_videofile(filename, fps=FPS)

os.system(f"ffmpeg -r {FPS} -i {imageset_path}/frame_%04d.png {filename}")
1 change: 0 additions & 1 deletion examples/Visualization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ python continuum_snake_render.py # Creates pov_snake_diag.mp4 and pov_snake_top

### Dependency
- povray
- moviepy
- ffmpeg

0 comments on commit 253c057

Please sign in to comment.