Use ffprobe, grep and cut to list metadata of video.mp4 and 'grep' the duration value of the video.
The -select_streams parameter to ffprobe will select the specific stream you want to evaluate. Acceptable values are: a for audio, v for video and d for data.
Running the command without | grep "duration=" | cut -d '=' -f 2 will log to the screen all the metadata stored on the file container format. The data includes: width and height of the video, codec_name, codec_type, avg_frame_rate (fps), nb_frames (total number of frames) and more.
The following is a ffprobe dump of the file yoga.mp4.
https://www.ffmpegbyexample.com/examples/l1bilxyl/get_the_duration_of_audio_or_video_file_using_ffmpeg_ffprobe/
Use ffprobe, grep and cut to list metadata of
video.mp4
and 'grep' the duration value of the video.The
-select_streams
parameter toffprobe
will select the specific stream you want to evaluate. Acceptable values are:a
for audio,v
for video andd
for data.Running the command without
| grep "duration=" | cut -d '=' -f 2
will log to the screen all the metadata stored on the file container format. The data includes:width
andheight
of the video,codec_name
,codec_type
,avg_frame_rate
(fps),nb_frames
(total number of frames) and more.The following is a ffprobe dump of the file yoga.mp4.