Skip to main content

Convenience facilities for using FFmpeg (ffmpeg.org), with invocation via `ffmpeg-python`.

Project description

Convenience facilities for using FFmpeg (ffmpeg.org), with invocation via ffmpeg-python.

Latest release 20240519: ffmpeg_docker: set DockerRun.output_hostdir from the output file dirname.

Class ConversionSource(builtins.tuple)

ConversionSource(src, srcfmt, start_s, end_s)

Property ConversionSource.end_s: Alias for field number 3

Property ConversionSource.src: Alias for field number 0

Property ConversionSource.srcfmt: Alias for field number 1

Property ConversionSource.start_s: Alias for field number 2

Function convert(*srcs, dstpath: str, doit=True, dstfmt=None, ffmpeg_exe=None, fstags: Optional[cs.fstags.FSTags] = <function <lambda> at 0x10bd092d0>, conversions=None, metadata: Optional[dict] = None, timespans=(), overwrite=False, acodec=None, vcodec=None, extra_opts=None) -> List[str]

Transcode video to dstpath in FFMPEG compatible dstfmt.

Function 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, docker_exe: Optional[str] = None, image: Optional[str] = None, output_hostdir: Optional[str] = None) -> Optional[subprocess.CompletedProcess]

Invoke ffmpeg using docker.

Class FFmpegSource

A representation of an ffmpeg input source.

Method 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.

Method FFmpegSource.promote(source): Promote source to an FFmpegSource.

Function ffprobe(input_file, *, doit=True, ffprobe_exe='ffprobe', quiet=False)

Run ffprobe -print_format json on input_file, return format, stream, program and chapter information as an AttrableMapping (a dict subclass).

Function main_ffmpeg_docker(argv=None)

The ffm[peg-docker command line implementation.

Class MetaData(cs.tagset.TagSet)

Object containing fields which may be supplied to ffmpeg's -metadata option.

Method MetaData.__init__(self, format, **kw): pylint: disable=redefined-builtin

Method MetaData.options(self): Compute the FFmpeg -metadata option strings and return as a list.

Release Log

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cs.ffmpegutils-20240519.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

cs.ffmpegutils-20240519-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file cs.ffmpegutils-20240519.tar.gz.

File metadata

  • Download URL: cs.ffmpegutils-20240519.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.6

File hashes

Hashes for cs.ffmpegutils-20240519.tar.gz
Algorithm Hash digest
SHA256 d70cb00f58e1e26e790029a57adde62e1677b67422d85bc41cd38cf2b5106e11
MD5 23c1a3a58d59087ef91225160bd13da8
BLAKE2b-256 1f939e9cf8260a7d3c5df382fdb7b477aab657fdd934a3b26d224aec35215e91

See more details on using hashes here.

File details

Details for the file cs.ffmpegutils-20240519-py3-none-any.whl.

File metadata

File hashes

Hashes for cs.ffmpegutils-20240519-py3-none-any.whl
Algorithm Hash digest
SHA256 8f320374330072ae9ed79f57245c0c2f028ef3b87d466151dc93911bc38e87cc
MD5 80d923c470f9cdb98ff616a33df5a78c
BLAKE2b-256 2a723b8e31e3e1ce02a610d4cc972dd49ae04b2bcdaf2e63093e0691a4bd4897

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page