|
|
@ -1,4 +1,5 @@ |
|
|
|
import subprocess |
|
|
|
# import subprocess |
|
|
|
import os |
|
|
|
from pathlib import Path |
|
|
|
|
|
|
|
from lightning import Callback |
|
|
@ -69,4 +70,5 @@ class SaveImageCallback(Callback): |
|
|
|
# w, h = self.figsize[0] * self.dpi, self.figsize[1] * self.dpi |
|
|
|
w, h = 7680, 4320 |
|
|
|
_cmd = f'ffmpeg -r {fps} -f image2 -i {log_dir}/e%04d.png -vcodec libx264 -crf 25 -pix_fmt yuv420p -vf "scale={w}:{h}:force_original_aspect_ratio=decrease,pad={w}:{h}:(ow-iw)/2:(oh-ih)/2:color=white" {log_dir}/a{version}.mp4' |
|
|
|
_ = subprocess.Popen(_cmd, shell=True) |
|
|
|
# _ = subprocess.Popen(_cmd, shell=True) |
|
|
|
os.system(_cmd) |
|
|
|