Convenience facilities for using FFmpeg (ffmpeg.org),
with invocation via ffmpeg-python.
Latest release 20260531: FFMPEG_DOCKER_IMAGE_DEFAULT=docker.io/linuxserver/ffmpeg, adjust for cs.dockerutils changes.
Short summary:
ConversionSource: ConversionSource(src, srcfmt, start_s, end_s).convert: Transcode video todstpathin FFMPEG compatibledstfmt.ffmpeg_docker: Invokeffmpegusing docker.FFmpegSource: A representation of anffmpeginput source.ffprobe: Runffprobe -print_format jsononinput_file, return format, stream, program and chapter information as anAttrableMapping(adictsubclass).main_ffmpeg_docker: Theffm[peg-dockercommand line implementation.MetaData: Object containing fields which may be supplied to ffmpeg's -metadata option.
Module contents:
ConversionSource.__replace__(self, /, **kwds):
Return a new ConversionSource object replacing specified fields with new values
ConversionSource.end_s:
Alias for field number 3
ConversionSource.src:
Alias for field number 0
ConversionSource.srcfmt:
Alias for field number 1
ConversionSource.start_s:
Alias for field number 2
-
convert(*srcs, dstpath: str, doit=True, dstfmt=None, ffmpeg_exe=None, fstags: Optional[cs.fstags.FSTags] = <function <lambda> at 0x10e323a60>, conversions=None, metadata: Optional[dict] = None, timespans=(), overwrite=False, acodec=None, vcodec=None, extra_opts=None) -> List[str]: Transcode video todstpathin FFMPEG compatibledstfmt.Parameters:
srcs: the positional parameters specify source filesdoit: optional flag (defaultTrue); do not procude the output if falsedstfmt: optional destination formatffmpeg_exe: optionalffmepgexecutableconversions: optional format conversionsmetadata: an optional mapping of metadata valuestimespans: optional timespans to select form the sourcesoverwrite: optional flag (defaultFalse); if true allow overwriting an existing destination fileacodec: optional target audio codecvcodec: optional target video codecextra_opts: an optional mapping of additional ffmpeg output options
-
ffmpeg_docker(*ffmpeg_args: Iterable[str], docker_run_opts: Union[List[str], Mapping, NoneType] = None, doit: Optional[bool] = None, quiet: Optional[bool] = None, ffmpeg_exe: Optional[str] = None, image: Optional[str] = None, output_hostdir: Optional[str] = None) -> Optional[subprocess.CompletedProcess]: Invokeffmpegusing docker. -
class FFmpegSource: A representation of anffmpeginput source.
FFmpegSource.add_as_input(self, ff):
Add as an input to ff.
Return None if self.source is a pathname,
otherwise return the file descriptor of the data source.
Note: because we rely on ff.input('pipe:') for nonpathnames,
you can only use a nonpathname FFmpegSource for one of the inputs.
This is not checked.
FFmpegSource.promote(source):
Promote source to an FFmpegSource.
ffprobe(input_file, *, doit=True, ffprobe_exe='ffprobe', quiet=False): Runffprobe -print_format jsononinput_file, return format, stream, program and chapter information as anAttrableMapping(adictsubclass).main_ffmpeg_docker(argv=None): Theffm[peg-dockercommand line implementation.class MetaData(cs.tagset.TagSet): Object containing fields which may be supplied to ffmpeg's -metadata option.
MetaData.__init__(self, format, **kw):
pylint: disable=redefined-builtin
MetaData.options(self):
Compute the FFmpeg -metadata option strings and return as a list.
Release Log
Release 20260531: FFMPEG_DOCKER_IMAGE_DEFAULT=docker.io/linuxserver/ffmpeg, adjust for cs.dockerutils changes.
Release 20241122: Honour the $FFMPEG_DOCKER_IMAGE environment variable.
Release 20240519: ffmpeg_docker: set DockerRun.output_hostdir from the output file dirname.
Release 20240316.1: DISTINFO fix.
Release 20240316: Fixed release upload artifacts.
Release 20240201:
- New $FFMPEG_EXE envvar.
- convert: use $FFMPEG_EXE, return the ffmpeg argv.
- convert: include the media type in DEFAULT_CONVERSIONS, refactor the choice of codec conversion.
- convert: supply dummy results if doit is false - could do with some finesse.
- ffmpeg_docker: use DockerRun.{add_input,add_output}.
- New main_ffmpeg_docker to support the ffmpeg-docker command, add ffmpeg-docker to DISTINFO scripts.
Release 20231202: Initial PyPI release.
Release files for cs-ffmpegutils 20260531
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cs_ffmpegutils-20260531.tar.gz | 6.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cs_ffmpegutils-20260531-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 14.9 kB
Release files / cs_ffmpegutils-20260531.tar.gz
| Download URL | cs_ffmpegutils-20260531.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b3d2e4c97752f6d4c7e3fc9cf1e459880c97117b63b6684cb93a5b894c89f3fa
|
|
BLAKE2b-256 checksum How to use checksums |
fe5b6b910c6e005da81e237c421545e4abcb5188f8c6d55863e1104f96db56ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|
Release files / cs_ffmpegutils-20260531-py2.py3-none-any.whl
| Download URL | cs_ffmpegutils-20260531-py2.py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
cab95e125ec39010194aea09cb612f2c25191239bc7e16bc951bb213c8e46421
|
|
BLAKE2b-256 checksum How to use checksums |
dc6030516d5eb2964c83d90c4ed658143e2fba553f9c0ea8bb2b554f453c08b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|