Skip to content

gurrutia/videoxt

Repository files navigation

PyPI Downloads tests

VideoXT is a simple library and CLI tool for extracting audio, individual frames, short clips and GIFs from videos.

See the documentation for more details.


Installation

Available on pypi.

pip install videoxt

Usage

From the command-line:

# extract audio from a video file (default: 'mp3')
$ videoxt audio MyVideo.mp4
{"video": {"filepath": "C:/Users/gurrutia/MyVideo.mp4", ...}, "start_time": 0, ...}
# extracting audio...
{"success": true, ...}
$ ls
MyVideo.mp4  MyVideo.mp3

As a library:

$ python
>>> # extract all frames from a video file (default: 'jpg')
>>> import videoxt
>>> filepath = 'C:/Users/gurrutia/MyVideo.mp4'  # or <class 'pathlib.Path'>
>>> result = videoxt.extract_frames(filepath)  # or videoxt.extract('frames', filepath)
>>> result.destpath
pathlib.Path('C:/Users/gurrutia/MyVideo.mp4_frames')
>>> result.elapsed_time
3.14159265358979323
>>> len(list(result.destpath.glob('*.jpg'))) # default: 'jpg'
100  # number of frames extracted
>>> result.json()
{'success': True, ...}

Contributing

For guidance on setting up a development environment and to make a contribution, see the contributing guidelines.


Used By

  • Best Buy Teen Tech Center at Grand St. Settlement, allowing filmmaking instructors to gather film stills that aid in constructing lesson plans for their youth workshops. Download a workshop example here.