获取目录中所有音频/视频长度的命令行工具
playlist-length的Python项目详细描述
播放列表长度
一种命令行工具,用于计算目录中所有音频/视频的长度
先决条件
ffmpeg要使此包正常工作,需要将其安装到系统上
在ubuntu上安装ffmpeg
sudo add-apt-repository ppa:mc3man/trusty-media
sudo apt-get update
sudo apt-get install ffmpeg
sudo apt-get install frei0r-plugins
对于其他操作系统,请阅读指令here
安装
启动终端并键入以下命令
$ pip install --user playlist-length
或
$ pip install --user -e git+https://github.com/karansthr/playlist-length#egg=playlist-length
如果~/.local/bin/不在路径中,则运行
$ export PATH=$PATH:${HOME}/.local/bin/
您可以在~/.zshrc或~/.bashrc等中添加上述代码行,以便在每次打开终端时重复上述步骤。
要获取目录中所有视频的长度,请将目录的路径指定为arguement
$ playlistlen path_to_directory
或对当前目录使用以下命令
$ playlistlen
默认情况下,它将递归地在给定目录及其子目录中查找视频,如果您希望它只在给定目录中查找,则使用--no subdir标志,例如:
$ playlistlen path_to_directory --no-subdir
默认情况下,它将查找的媒体类型是video
,但您可以指定audio
或both
$ playlistlen path_to_directory --media-type audio
$ playlistlen path_to_directory --media-type both
对于帮助,请使用-h或--help,例如
$ playlistlen --help
作者
- karan suthar(https://github.com/karansthr)
- mohit solanki(https://github.com/mohi7solanki)
许可证
这个项目是在麻省理工学院的许可下授权的-详细信息请参见LICENSE文件