There are some teaching sessions where the video duration/length is quite different to the audio lengths, and therefore I need to check the duration of all the videos and audios. I found this bash script to display the duration of MP3 files and simply modified it to display MP4 files as well ..
and the output is ..Code:#!/bin/bash for file in *.mp3 *.mp4 do duration=$(ffprobe "$file" 2>&1 | awk '/Duration/ { print $2 }') echo -e $duration"\t"$file done | sort -n
but when I try the script in a higher level path/directory, where there are only folders (no files), the output is obviously an error because the script does not cater for going down all the paths recursively ..00:29:06.67, Session 3 - Session3Audio.mp3
00:29:30.60, Session 3 - Session3Video.mp4
00:46:12.31, Session 2 - Session2Audio.mp3
00:46:12.31, Session 4 - Session4Audio.mp3
00:46:36.25, Session 2 - Session2Video.mp4
00:54:45.74, Session 1 - Session1Audio.mp3
00:55:09.70, Session 1 - Session1Video.mp4
01:14:53.99, Session 4 - Session4Video.mp4
Can someone please tell me how to modify the bash script to make it do a recursive search. Also, I wanted to copy the output into a spreadsheet, so that the filename is first, then the duration. Is that simply a matter of adding a TAB character so that an import to the spreadsheet will be placed into columns.*.mp3
*.mp4
Bookmarks