Admit a drawn video's exact clock and raster and plan the one FFmpeg run that encodes its frames, with an optional soundtrack.
The frame count is durationSeconds × fps and must be a whole number from 1 to a million, so the clock has no partial frame to round. The raster must be positive and even on both sides, which the yuv420p chroma layout needs. The encoder and following audit share the exact rational rate selected for the commissioned numeric frame rate. The arguments are ffmpegArgs over the frame pattern in frameDir, quiet below warnings, with four encoder threads and the medium preset, -frames:v and -t pinned to the clock, and the video stream mapped explicitly; a soundtrack is the second input, padded with silence (apad) and cut at the clock as 48 kHz stereo AAC at 192 kb/s, and without one the output has no audio stream.
It throws naming what is refused: a clock that is not a whole number of frames in range, an odd or empty raster, and a blank soundtrack path.
Admit a drawn video's exact clock and raster and plan the one FFmpeg run that encodes its frames, with an optional soundtrack.
The frame count is
durationSeconds × fpsand must be a whole number from 1 to a million, so the clock has no partial frame to round. The raster must be positive and even on both sides, which theyuv420pchroma layout needs. The encoder and following audit share the exact rational rate selected for the commissioned numeric frame rate. The arguments areffmpegArgsover the frame pattern inframeDir, quiet below warnings, with four encoder threads and themediumpreset,-frames:vand-tpinned to the clock, and the video stream mapped explicitly; a soundtrack is the second input, padded with silence (apad) and cut at the clock as 48 kHz stereo AAC at 192 kb/s, and without one the output has no audio stream.It throws naming what is refused: a clock that is not a whole number of frames in range, an odd or empty raster, and a blank soundtrack path.