根据偏移量列表将一个媒体文件拆分为多个
splitmedia的Python项目详细描述
一种使用ffmpeg将媒体文件和具有偏移量的列表文件分割成多个部分的工具。
用法
示例用法:
$ splitmedia media.file list.txt output_path
输出
分割地震原声带:
$ splitmedia "Quake Soundtrack.m4a" list_file.quake quake_output OFF 000:00:00.000 DUR 000308.000 01_QuakeTheme.m4a OFF 000:05:08.000 DUR 000146.000 02_Aftermath.m4a OFF 000:07:34.000 DUR 000500.000 03_TheHallofSouls.m4a OFF 000:15:54.000 DUR 000366.000 04_ItisRaed.m4a OFF 000:22:00.000 DUR 000444.000 05_ParallelDimensions.m4a OFF 000:29:24.000 DUR 000519.000 06_Life.m4a OFF 000:38:03.000 DUR 000336.000 07_Damation.m4a OFF 000:43:39.000 DUR 000388.000 08_Focus.m4a OFF 000:50:07.000 DUR 000213.000 09_Falling.m4a OFF 000:53:40.000 DUR 000315.000 10_TheReaction.m4a ...
依赖关系
- python 2.7版
- ffmpeg
列表文件示例
在项目中还以list_file.formats的形式提供:
0:00:00.123 filepart1 0:03:10 filepart2 0:09:20 filepart3 1300 filepart4 1345.456 filepart5 1347 filepart6
列出文件注释
- 偏移量可以是整数或全时规范
- 秒可以是小数
- 可以使用哈希前缀注释
- 可以有空行(用于组织)
- 文件名将被自动清除(删除不适当的字符)
命令行
命令行帮助:
usage: splitmedia [-h] media_filepath list_filepath output_path Split the media file into multiple parts by times positional arguments: media_filepath File-path of the media file list_filepath File-path of the list output_path Output path optional arguments: -h, --help show this help message and exit