Close Menu
    Facebook X (Twitter) Instagram Pinterest YouTube
    Trending
    • Disable SSH Password Login on Raspberry Pi
    • Elecrow Meteor IPS Touchscreen with RGB LEDs
    • Pi Pico Pinout Display on the Command Line
    • How to Add a Raspberry Pi Pico Reset Button
    • Pi Pico Onboard LED
    • Pi Pico W Pinout and Power Pins
    • CrowPi L Raspberry Pi Laptop and Learning Platform
    • Pi Pico W Launched
    Mastodon YouTube Facebook Instagram Pinterest RSS
    Raspberry Pi SpyRaspberry Pi Spy
    • Home
    • Categories
      • General
      • Hardware
      • Programming
      • Python
      • Software
      • Tutorials & Help
    • BerryClip
      • BerryClip Instructions
      • BerryClip Plus Instructions
      • Videos & Reviews
    • Buy
      • Buy Pi
      • Buy Pi Accessories
      • Buy Books
    • Tools
      • Ultimate Raspberry Pi Alexa Skill
      • Pi Power Estimator App
      • Pi-Lite 14×9 LED Matrix Sprite Editor
      • RPiREF Pin-out Reference App
      • Simple Ohm’s Law Calculator
      • Web Sites & Links
    • Tutorials & Help
        Featured
        November 9, 20200

        Raspberry Pi Temperature Monitoring

        Recent
        February 16, 2024

        Disable SSH Password Login on Raspberry Pi

        December 23, 2022

        How to Add a Raspberry Pi Pico Reset Button

        November 20, 2022

        Pi Pico Onboard LED

      1. Contact Us
      2. Site Map
      Raspberry Pi SpyRaspberry Pi Spy
      You are at:Home»Tutorials & Help»How To Get Media Info From Raspberry Pi Command Line
      HDMIPi

      How To Get Media Info From Raspberry Pi Command Line

      2
      By Matt on September 28, 2014 Tutorials & Help

      Whether you are using your Raspberry Pi to play media or create it you may have a need to examine the properties of various bits of media. This might include MP3, MP4 or JPG files.

      There is an easy way to examine the properties using a utility called “MediaInfo”. MediaInfo is available for a wide range of operating systems and languages and I use it on my Windows 7 PC.

      MediaInfo can provide lots of detail including :

      • General : title, author, director, album, track number, date, duration …
      • Video: format, codec id, aspect, frame rate, bit rate …
      • Audio: format, codec id, sample rate, channels, language, bit rate …

      Install MediaInfo

      To install the package you can use the command :

      sudo apt-get install -y mediainfo

      Using MediaInfo

      To examine an MP3 file you can use :

      mediainfo /home/pi/test.mp3

      where “/home/pi/test.mp3” is the path to the file. If you are already in the required directory you can simply type :

      mediainfo test.mp3

      Here is an example output from an MP3 :

      Mediainfo Example - Audio

      It’s equally easy to grab information from video files :

      mediainfo myvideo.mp4

      Here is an example output from an avi file :

      Mediainfo Example - Video

      This output can re-directed to a text file using :

      mediainfo example.mp4 > info.txt

      Supported Formats

      Mediainfo supports most of the formats you are likely to need :

      • Matroska (mkv/mka/mks)
      • Ogg (ogg/ogm)
      • Riff (avi/wav)
      • Mpeg 1&2 container (mpeg/mpg/vob)
      • Mpeg 4 container (mp4)
      • Mpeg video specific (mpgv/mpv/m1v/m2v)
      • Mpeg audio specific (mp2/mp3)
      • Windows Media (asf/wma/wmv)
      • Quicktime (qt/mov)
      • Real (rm/rmvb/ra)
      • DVD-Video (ifo)
      • AC3 (ac3)
      • DTS (dts)
      • AAC (aac)
      • Monkey’s Audio (ape/mac)
      • Flac (flac)
      • CDXA, like Video-CD (dat)
      • Apple/SGI (aiff/aifc)
      • Sun/NeXT (au)
      • Amiga IFF/SVX8/SV16 (iff)
      • Ensoniq PARIS (paf)
      • Sound Designer 2 (sd2)
      • Berkeley/IRCAM/CARL (irca)
      • SoundFoundry WAVE 64 (w64)
      • Matlab (mat)
      • Portable Voice format (pvf)
      • FastTracker2 Extanded (xi)
      • Midi Sample dump Format (sds)
      • Audio Visual Research (avr)

      Additional information on the metadata items that can be extracted from these file types is detailed on the Mediainfo Formats page.

      If you want some test media for your Pi then you can grab some decent free, legal video from the Big Buck Bunny download site.

      Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
      Previous ArticleLearning to Solder Is Easier Than You Think!
      Next Article ProtoCam – A Camera Module Prototyping Board For The Pi

      Related Posts

      Disable SSH Password Login on Raspberry Pi

      How to Add a Raspberry Pi Pico Reset Button

      Pi Pico Onboard LED

      2 Comments

      1. Jury D'Ambros on April 9, 2016 3:20 pm

        this is the full output i got:

        sudo apt-get install -y mediainfo
        Reading package lists… Done
        Building dependency tree
        Reading state information… Done
        Package mediainfo is not available, but is referred to by another package.
        This may mean that the package is missing, has been obsoleted, or
        is only available from another source

        E: Package ‘mediainfo’ has no installation candidate

        Reply
        • Matt on April 11, 2016 5:00 pm

          Try running :
          sudo update
          and then trying the install.

          Reply
      Leave A Reply Cancel Reply

      This site uses Akismet to reduce spam. Learn how your comment data is processed.

      Recent Posts
      February 16, 2024

      Disable SSH Password Login on Raspberry Pi

      March 13, 2023

      Elecrow Meteor IPS Touchscreen with RGB LEDs

      December 26, 2022

      Pi Pico Pinout Display on the Command Line

      December 23, 2022

      How to Add a Raspberry Pi Pico Reset Button

      November 20, 2022

      Pi Pico Onboard LED

      Categories
      • 1-wire
      • 3D Printing
      • Add-ons
      • BBC Micro:bit
      • BerryClip
      • Books
      • Camera Module
      • Cases
      • Events
      • General
      • Hardware
      • I2C
      • Infographics
      • Interfaces
      • Minecraft
      • Model A+
      • Model B+
      • News
      • Pi Models
      • Pi Pico
      • Pi Zero
      • Power
      • Programming
      • Python
      • Raspberry Pi OS
      • Raspbian
      • RetroGaming
      • Robotics
      • Sensors
      • Software
      • SPI
      • Tutorials & Help
      Tags
      Arduino audio battery berryclip Birthday bluetooth cambridge camera CamJam DigiMakers display games GPIO I2C interface Kickstarter Kodi LCD LED Linux media Minecraft Model A motionEyeOS PCB photography photos Pi-Lite Pi Pico power python Raspberry Jam Raspberry Pi Bootcamp raspbian Retrogaming retroPie screen SD card security sensor SPI SSH temperature ultrasonic video
      Raspberry PI Related
      • Adafruit Blog
      • Average Maker
      • Official RaspBerry Pi Site
      • Raspberry Pi Pod
      • RasPi.tv
      • RaspTut
      • Stuff About Code
      Tech Resources
      • MattsBits – Pi Resources
      • Microbit Spy
      • Technology Spy
      Archives

      Entries RSS | Comments RSS

      This site is not associated with the official Raspberrypi.org site or the Raspberry Pi Foundation. Raspberry Pi is a trademark of the Raspberry Pi Foundation.

      Copyright © 2025 - All Rights Reserved - Matt Hawkins

      About

      Unofficial site devoted to the Raspberry Pi credit card sized computer offering tutorials, guides, resources,scripts and downloads. We hope to help everyone get the most out of their Pi by providing clear, simple articles on configuring, programming and operating it.

      Popular Posts
      September 19, 2014

      Top 5 Reasons The Raspberry Pi Sucks

      July 27, 2012

      16×2 LCD Module Control Using Python

      October 20, 2013

      Analogue Sensors On The Raspberry Pi Using An MCP3008

      Latest Posts
      February 16, 2024

      Disable SSH Password Login on Raspberry Pi

      March 13, 2023

      Elecrow Meteor IPS Touchscreen with RGB LEDs

      December 26, 2022

      Pi Pico Pinout Display on the Command Line

      Mastodon YouTube Instagram Facebook Pinterest RSS

      Entries RSS | Comments RSS

      This site is not associated with the official Raspberrypi.org site or the Raspberry Pi Foundation. Raspberry Pi is a trademark of the Raspberry Pi Foundation.

      Copyright © 2025 - All Rights Reserved - Matt Hawkins

      mastodon.social@RPiSpy

      Type above and press Enter to search. Press Esc to cancel.