Created
July 17, 2016 08:50
-
-
Save mikaelz/5b82b2e38b87e737601025d0c3885c73 to your computer and use it in GitHub Desktop.
Generate .pls playlist for .mp4 files in the current directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
count=1 | |
echo "[playlist]" > ${PWD##*/}.pls | |
for v in *.mp4; do | |
echo "File$count=$v" >> ${PWD##*/}.pls | |
echo -n "Length$count=" >> ${PWD##*/}.pls | |
count=$((count+1)) | |
ffprobe -i $v -show_entries format=duration -v quiet -of csv="p=0" >> ${PWD##*/}.pls | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment