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