HOWTO: get the duration timestamp of a video file

Code and information to get you started with ffmpeg all the way through to advanced user.
Post Reply
User avatar
Administrator
Site Admin
Posts: 1725
Joined: Thu Mar 22, 2018 10:19 am

HOWTO: get the duration timestamp of a video file

Post by Administrator » Wed Mar 28, 2018 10:20 am

You can get the duration of a video file by using the following command

Code: Select all

ffmpeg -i 'file.mp4' 2>&1 | grep Duration | awk '{print $2}' | tr -d ,
this code will return the full time stamp of the video duration for further processing.

Example

Code: Select all

02:06:27.69
which in turn means from the left most.

hours:minutes:seconds

Post Reply