Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #212798

Re: Length of a video file (.avi, .mpg) from the command line

From Dan Ritter <dsr@randomstring.org>
Newsgroups linux.debian.user
Subject Re: Length of a video file (.avi, .mpg) from the command line
Date 2019-08-14 18:20 +0200
Message-ID <yv4ae-1GA-5@gated-at.bofh.it> (permalink)
References <yv3QR-1jB-9@gated-at.bofh.it> <yv3QR-1jB-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Jean-Baptiste Thomas wrote: 
> Can anyone recommend a command line program that could tell me
> the length of the video stream in a .avi or .mpg file ? Thanks
> in advance.

If you invoke

mplayer -vo none -ao none <filename>

you will get a set of statistics which include the resolution, 
frame rate, and encoding rate for both video and audio streams.

A little addition and division with the total size of the file
should get you a good idea.

ffmpeg -i <filename>

will do a similar set of stats, including doing some math for
you. (Look at "duration" in the output.)

However, everything is only *likely* to be correct, because
there are a number of encodings which can cause variable length.


-dsr-

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Length of a video file (.avi, .mpg) from the command line Jean-Baptiste Thomas <cau2jeaf1honoq@laposte.net> - 2019-08-14 18:00 +0200
  Re: Length of a video file (.avi, .mpg) from the command line Dan Ritter <dsr@randomstring.org> - 2019-08-14 18:20 +0200
  Re: Length of a video file (.avi, .mpg) from the command line Andy Smith <andy@strugglers.net> - 2019-08-14 18:30 +0200
  Re: Length of a video file (.avi, .mpg) from the command line Jonas Smedegaard <jonas@jones.dk> - 2019-08-14 19:40 +0200
  Re: Length of a video file (.avi, .mpg) from the command line Michael Lange <klappnase@freenet.de> - 2019-08-14 20:20 +0200

csiph-web