nerfplusplus icon indicating copy to clipboard operation
nerfplusplus copied to clipboard

code for final rendering

Open kam1107 opened this issue 4 years ago • 1 comments

Hi, Can you also provide the code for rendering the final video? Many thanks :)

kam1107 avatar Apr 19 '21 06:04 kam1107

Once you render the camera path, you can use the following script to create a video.

import imageio
import os

render_dir = '/path/to/rendered/camera/path'

frames = []
fps = 10

for item in sorted(os.listdir(render_dir)):
    if item.endswith('.png'):
        im = imageio.imread(os.path.join(render_dir, item))
        frames.append(im)

# rewind
frames = frames + frames[::-1]

imageio.mimwrite(render_dir + '.mp4', frames, fps=fps)

Kai-46 avatar Jun 23 '21 15:06 Kai-46