Encodes captured screenshots into an H.264 MP4 with ffmpeg, which
PhoenixReplay.Export.FFmpeg runs.
The screenshots go in through ffmpeg's concat demuxer, each with the time it lasts, and come out at the schedule's constant frame rate, so a picture that does not change is captured once and still fills its frames. The size is rounded down to even pixels, as H.264 needs, and the index is moved to the front so the video plays while it downloads.
Summary
Types
Called with the share of the video encoded so far, from 0 to 1.
Each screenshot's path and the frames it lasts, in order. The
screenshots share a directory and have plain names, such as 0.png,
so the concat list can name them as they are.
Functions
Encodes shots into path, reporting progress.
Types
Called with the share of the video encoded so far, from 0 to 1.
@type shots() :: [{Path.t(), pos_integer()}]
Each screenshot's path and the frames it lasts, in order. The
screenshots share a directory and have plain names, such as 0.png,
so the concat list can name them as they are.
Functions
@spec run(shots(), PhoenixReplay.Export.Schedule.t(), Path.t(), map(), progress()) :: :ok | {:error, PhoenixReplay.Export.FFmpeg.error()}
Encodes shots into path, reporting progress.