A command line tool for media editing
Project description
MEDIPACK
Medipack is Media + Package
, A command-line tool used to trim
, crop
, resize
media files.
It can also be used to extract
out audio
or video
from a media file.
Installation
Install using pip (Recommended)
sudo python3 -m pip install medipack
you may use --user
option to install locally for user only in ~/.local/bin
python3 -m pip install medipack --user
don't forget ~/.local/bin
should be in your PATH
. Add line export PATH=$PATH:"~/.local/bin"
in your .bashrc
Build from Source
- Clone the repository and checkout to stable commit
- git clone https://github.com/srbcheema1/medipack
- cd medipack
- git checkout <latest_version say: v0.0.x>
- `python3 setup.py install --user`
- install requirements
python3 -m pip install --user -r requirements.txt
- Install Medipack
python3 setup.py install --user
Verify installation
- check for working
medipack -h
- if it displays help message you are ready to go.
troubleshooting
-
In case
medipack -h
is not working, ensure that binary path is in PATH. Add lineexport PATH=$PATH:"~/.local/bin"
in your~/.bashrc
or~/.zshrc
. -
bash users run these commands
echo export PATH="$PATH":"~/.local/bin" >> ~/.bashrc
source ~/.bashrc
- zsh users run these commands
echo export PATH="$PATH":"~/.local/bin" >> ~/.zshrc
source ~/.zshrc
Usage
srb@srb-pc:$ medipack --help
usage: medipack.py [-h] [-v] {trim,crop,resize,extract} ...
positional arguments:
{trim,crop,resize,extract}
optional arguments:
-h, --help show this help message and exit
-v, --version Display version number
suboptions are:
trim trim a video/audio file from given starting point to given ending point.
crop crop frame window of video.
resize resize the file by reducing video quality. to make small size video files.
extract extract audio-only or video-only file from media file
For more help regarding suboptions run:
medipack trim -h
medipack crop -h
medipack resize -h
medipack extract -h
Supported formats
- mp4
- mp3
supported actions
- trim
- crop
- resize
- extract
Examples
trim
srb@srb-pc:$ medipack trim -h
usage: medipack trim [-h] [-s START] [-e END | -t TIME] [-o OUTPUT] [inp]
positional arguments:
inp input video file ex: input.mp4
optional arguments:
-h, --help show this help message and exit
-s START, --start START
start time for cuting in format hh:mm:ss or mm:ss
-e END, --end END end time for cuting in format hh:mm:ss or mm:ss
-t TIME, --time TIME clip duration in format hh:mm:ss or mm:ss
-o OUTPUT, --output OUTPUT
- trimming a video from 01:04 to 14:08
medipack trim input.mp4 -s 01:04 -e 14:08 -o output.mp4
medipack trim input.mp4 -s 01:04 -t 13:04 -o output.mp4
medipack trim input.mp4 -s 01:04 -e 14:08
medipack trim input.mp4 -s 01:04 -t 13:04
medipack trim input.mp4
medipack trim
- trimming an audio from 01:04 to 14:08
medipack trim input.mp3 -s 01:04 -e 14:08 -o output.mp3
crop
srb@srb-pc:$ medipack crop -h
usage: medipack crop [-h] [-t TOP] [-b BOTTOM] [-l LEFT] [-r RIGHT]
[-o OUTPUT]
[inp]
positional arguments:
inp input video file ex: input.mp4 (default: None)
optional arguments:
-h, --help show this help message and exit
-t TOP, --top TOP percentage of screen to be chopped from top (default: 0)
-b BOTTOM, --bottom BOTTOM
percentage of screen to be chopped from bottom (default: 0)
-l LEFT, --left LEFT percentage of screen to be chopped from left (default: 0)
-r RIGHT, --right RIGHT
percentage of screen to be chopped from right (default: 0)
-o OUTPUT, --output OUTPUT
output file name, ex: output.mp4 (default: None)
- To crop the bottom right quarter of a video window
medipack crop input.mp4 -t 50 -l 50 -o output.mp4
medipack crop input.mp4 -t 50 -l 50
- To crop away top 10% of area
medipack crop input.mp4 -t 10 -o output.mp4
- To crop away right 20% of the area
medipack crop input.mp4 -r 20 -o output.mp4
- To crop away top 10% of area and right 20% of the area
medipack crop input.mp4 -t 10 -r 20 -o output.mp4
resize
srb@srb-pc:$ medipack resize -h
usage: medipack resize [-h] [-q QUALITY] [-o OUTPUT] [inp]
positional arguments:
inp input video file ex: input.mp4
optional arguments:
-h, --help show this help message and exit
-q QUALITY, --quality QUALITY
output video quality (on scale of 100) (default: 50)
-o OUTPUT, --output OUTPUT
output file name, ex: output.mp4
- To resize a video to reduce its size
medipack resize input.mp4 -q 40 -o output.mp4
medipack resize input.mp4 -q 40
extract
srb@srb-pc:$ medipack extract -h
usage: medipack extract [-h] (-v | -a) [-o OUTPUT] [inp]
positional arguments:
inp input video file ex: input.mp4
optional arguments:
-h, --help show this help message and exit
-v, --video
-a, --audio
-o OUTPUT, --output OUTPUT
output file name
- To extract audio from media file
medipack extract --audio input.mp4 -o output.mp3
medipack extract --audio input.mp4
- To extract video from media file
medipack extract input.mp4 --video -o output.mp4
medipack extract input.mp4 --video
Note
- For audio-input files only trim action is supported.
- If you dont provide output file then the outputfile will be names as _output. for base.extension file. [except
extract
option in this output file will get name .mp3 by default] - You may skip options, medikit is smart enough to detect or ask you the required options as per requirement
- In case of any bug/issue, Please report this to srbcheema2@gmail.com. Or, even better, submit a PR to fix it!
Contact / Social Media
Development by
Developer / Author: Srb Cheema
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
medipack-2.0.5.tar.gz
(12.0 kB
view details)
File details
Details for the file medipack-2.0.5.tar.gz
.
File metadata
- Download URL: medipack-2.0.5.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad7b6849e3bd3dae8ee9d8e0c79adba3b08e535db1387b21d0fdcda97a97c52c |
|
MD5 | 050668bf975a8d098775d7fc31ad4065 |
|
BLAKE2b-256 | 1268e51b1ce83776df35c32c181da35f6b1067de4d38f9d2a6f249e9ebf2086d |