Get the duration of a audio or video file using ffmpeg / ffprobe

0
11
No Preview.

If you feel like this example could be improved, you may edit this example here.

ffprobe -show_streams -select_streams v -v quiet video.mp4 | grep "duration=" | cut -d '=' -f 2

1 comment
Anonymous
Markdown is supported
@eladg
eladgcommented4 months ago

Better solution:

ffprobe -loglevel quiet -output_format csv=p=0 -show_entries format=duration video.mp4

source: https://news.ycombinator.com/item?id=42709817