Wednesday, 13 November 2019

linux - How can I get the length of a video file from the console?


Suppose we have a video file some_video.


How can I get its length from a shell script (with mplayer/transcode/gstreamer/vlc/ffmpeg/whatever)?


VIDEO_LENGTH_IN_SECONDS=`ffmpeg .... -i some_video ... | grep -o .....`

Answer



ffprobe -i some_video -show_entries format=duration -v quiet -of csv="p=0"

will return the video duration in seconds.


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...