I have ten media files in a folder. I want to create a text file containing two columns - filename and its duration (seconds):
video1.mp4|300 seconds
video2.mp4|360 seconds
video3.mp4|420 seconds
...
audio10.wav|120 seconds
I did not find any similar question on the Web, so I don't have any hint of how to do this...
Enumerate the media files and parse
Duration:
line in the output offfmpeg -i
:With
ffprobe
(a part of ffmpeg package) the durations will have microsecond precision:Alternatively you can use a much faster MediaInfo CLI to output duration in milliseconds: