Playlist Length Calculator

A Python package, CLI tool to calculate the length of all the video files and/or audio files in a directory and its sub-directories

Posted by Karan on August 24, 2018   4704 views

playlistlen | fosstack


To install playlist-length:

pip install playlist-length --user


pip install --user -e git+



ffmpeg is required for this package to work,

To check if it is installed run following command in your terminal:

ffmpeg -version

If it is not installed, you can install it according to your platform.

For Arch:

 sudo pacman -S ffmpeg

For Ubuntu

sudo add-apt-repository ppa:mc3man/trusty-media
sudo apt-get update
sudo apt-get install ffmpeg
sudo apt-get install frei0r-plugins

For other OS read instructions here



To get the length of all the videos in a directory, give the path as an argument

$ playlistlen path_to_directory

or use the following command for current directory

$ playlistlen

By default, the media-type it will look for is video but you can specify audio or both

$ playlistlen path_to_directory --media-type audio
$ playlistlen path_to_directory --media-type both

By default, it will look directory and it's sub-directories recursively if you want it to look in the given directory only, then use --no-subdir flag, for example

$ playlistlen path_to_directory --no-subdir

Repository link:


blog comments powered by Disqus