Skip to main content

Get the dimensions of a video file with mediainfo

  • Posted

Here are two examples:

$ mediainfo '--Inform=Video;%Width%' speech.mp4
640

$ mediainfo '--Inform=Video;%Height%' speech.mp4
360

Update, : This doesn’t account for videos which have a non-trivial pixel aspect ratio. For a more reliable way to get the dimensions of a video, see The square pixels that aren’t square.