mendevi.cmd.CmdFFMPEG

class mendevi.cmd.CmdFFMPEG(video: Path | str, **kwargs: dict[str])[source]

Allow easy manipulation of a complete ffmpeg expression.

ffmpeg -y -hide_banner -loglevel verbose

Attributes

generallist[str]

The options immediately after ffmpeg and immediately before the decoder (read and write).

decodelist[str]

The options between -c:v and -i (read and write).

videopathlib.Path

The input video path (readonly).

vid_filterstr

The filter string after -vf (read and write).

encodelist[str]

The encoder name and options after -c:v (read and write).

outputlist[str]

The final arguments of the ffmpeg cmd (read and write).

Initialise the ffmpeg cmd.

Parameters

videopathlike

The input video path.

**kwargs: dict

See above.

generallist[str], str, optional

The options immediately after ffmpeg and immediately before the decoder.

decodelist[str], str, optional

The options between -c:v and -i.

vid_filterstr, optional

The filter string after -vf.

encode: list[str], str, optional

The encoder name and options after -c:v.

output: list[str], str, default=”-f null -”

The final arguments of the ffmpeg command, after the encoder description.

copy() Self[source]

Return an independant copy of self.

property decode: list[str]

Return the options between -c:v and -i.

property encode: list[str]

Return the encoder name and options after -c:v.

property general: list[str]

Return the options immediately after ffmpeg and immediately before the decoder.

property output: list[str]

Return the final arguments of the ffmpeg command, after the encoder.

run(cmd: list[str] | str | None = None) tuple[str, dict[str]][source]

Execute the command and return the stderr output.

If a cmd is provided, it is used instead of self.

property vid_filter: str

Return the filter string after -vf.

property video: Path

Return the input video path.