用于媒体编辑的命令行工具
项目描述
医疗包
Medipack 是Media + Package一个命令行工具,用于trim、crop、resize媒体文件。它也可以用于extract输出audio或输出video媒体文件。
安装
从源代码构建
git clone https://github.com/srbcheema1/medipackcd medipacksudo python3 setup.py install
使用 pip 安装
sudo python3 -m pip install medipack
您可以使用--user仅在本地为用户安装的选项,~/.local/bin
不要忘记~/.local/bin应该在您的PATH. export PATH=$PATH="~/.local/bin"在你的添加行.bashrc
用法
srb@srb-pc:$ medipack --help
usage: medipack [-h] {trim,crop,resize,extract} ...
positional arguments:
{trim,crop,resize,extract}
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
支持的格式
- mp4
- mp3
支持的操作
- 修剪
- 庄稼
- 调整大小
- 提炼
例子
修剪
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
- 从 01:04 到 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
- 从 01:04 到 14:08 修剪音频
medipack trim input.mp3 -s 01:04 -e 14:08 -o output.mp3
庄稼
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)
- 裁剪视频窗口的右下角四分之一
medipack crop input.mp4 -t 50 -l 50 -o output.mp4
medipack crop input.mp4 -t 50 -l 50
- 裁剪掉前 10% 的区域
medipack crop input.mp4 -t 10 -o output.mp4
- 裁剪掉 20% 的区域
medipack crop input.mp4 -r 20 -o output.mp4
- 裁剪掉顶部 10% 的区域和右侧 20% 的区域
medipack crop input.mp4 -t 10 -r 20 -o output.mp4
调整大小
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
- 调整视频大小以减小其大小
medipack resize input.mp4 -q 40 -o output.mp4
medipack resize input.mp4 -q 40
提炼
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
- 从媒体文件中提取音频
medipack extract --audio input.mp4 -o output.mp3
medipack extract --audio input.mp4
- 从媒体文件中提取视频
medipack extract input.mp4 --video -o output.mp4
medipack extract input.mp4 --video
笔记
- 对于音频输入文件,仅支持修剪操作。
- 如果您不提供输出文件,则输出文件将命名为 <base>_output.<extension> 用于 base.extension 文件。[
extract此输出文件中的选项除外,默认情况下将获得名称 .mp3] - 您可以跳过选项,medikit 足够聪明,可以根据要求检测或询问您所需的选项
- 如果有任何错误/问题,请向srbcheema2@gmail.com报告。或者,更好的是,提交 PR 来修复它!
联系方式/社交媒体
开发者
开发者/作者:Srb Cheema
项目详情
关
hell123-1.0.6.tar.gz的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 69df272cf40423e685b4aa84aba7c3e7c0b4e95c74f8173d506edfca84094f3d |
|
| MD5 | a6c899732907a7ec06e8b9b02fb3e70b |
|
| 布莱克2-256 | c1d225b5f241c66cd508810cd94de6af1579dd6b1d30b8929bd2be7b0b911f0f |