14 lines
527 B
Python
14 lines
527 B
Python
"""One encoder configuration shared by batched training and native app replay."""
|
|
from pathlib import Path
|
|
|
|
|
|
def video_writer(path: Path, width: int, height: int, fps: float):
|
|
"""Return an unprimed RGB24-to-H.264 streaming writer."""
|
|
import imageio_ffmpeg
|
|
|
|
Path(path).parent.mkdir(parents=True, exist_ok=True)
|
|
return imageio_ffmpeg.write_frames(
|
|
str(path), (width, height), fps=fps, codec="libx264", pix_fmt_in="rgb24",
|
|
pix_fmt_out="yuv420p", macro_block_size=1, ffmpeg_log_level="error",
|
|
)
|