Skip to content

Instantly share code, notes, and snippets.

@harshalbhakta
Created August 6, 2018 02:07
Show Gist options
  • Select an option

  • Save harshalbhakta/d10f0c67a7f1a4158b865118ee48c198 to your computer and use it in GitHub Desktop.

Select an option

Save harshalbhakta/d10f0c67a7f1a4158b865118ee48c198 to your computer and use it in GitHub Desktop.
Check video short info

Install mediainfo

$ sudo apt-get install mediainfo

Create a shell function in ~/.bashrc

shortvideoinfo() { 
   mediainfo --Inform="General;Duration=%Duration/String3%\nFile size=%FileSize/String4%" "$@"
   mediainfo --Inform="Video;Resolution=%Width%x%Height%\nCodec=%CodecID%" "$@"; 
}

Reload ~/.bashrc

$ . ~/.bashrc

Check video file info from command line

$ shortvideoinfo test.mp4

Sample Output

Duration=00:23:04.595
File size=744.2 MiB
Resolution=1920x1080
Codec=avc1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment