Video metadata contains information like author, title, genre, comment, and creation date. This information is embedded in the video file itself, but it not really a common practice for video releases to contain a lot of metadata info. If nothing else, there is usually some copyright information. In this tutorial, you will see how to get and change video metadata on a Linux system. This can be accomplished from both command line and GUI. We will cover both methods below.
In this tutorial you will learn:
- How to get and change video metadata from GUI
- How to get and change video metadata from command line
|Category||Requirements, Conventions or Software Version Used|
|System||Any Linux distro|
|Other||Privileged access to your Linux system as root or via the
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of
$ – requires given linux commands to be executed as a regular non-privileged user
How to get and change video metadata from GUI
Many video player and editors should have the ability to get and change metadata of video files. One such example is the VLC media player, which is available for free on Linux.
- First step is to install VLC with your system’s package manager:
Ubuntu, Debian, and Linux Mint: $ sudo apt install vlc Fedora: $ sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm $ sudo dnf install vlc Arch Linux and Manjaro: $ sudo pacman -S vlc
- Open up your video file in VLC. In VLC, navigate to Tools > Media Information. Alternatively, you can use the
Ctrl + Ishortcut on your keyboard.
- Under the General tab, you will see all of the metadata for your video file.
- If you want to change any of this metadata, just make your edits in this window, then press OK to save it. The new metadata will be written to the video file. To remove the metadata, just backspace the contents here and press OK.
- You can find any additional metata for the file under the Metadata tab.
How to get and change video metadata from command line
ExifTool is a command like program which can get and change video metadata. You can use the appropriate command below to install ExifTool with your system’s package manager.
$ sudo apt install libimage-exiftool-perl
$ sudo dnf install perl-Image-ExifTool
$ sudo pacman -S perl-image-exiftool
- To view all of the metadata for a video file, use the
exiftoolcommand and specify the name of your video file.
$ exiftool video.mp4
- To get a specific piece of metadata, such as the author, specify the option in your command:
$ exiftool -comment video.mp4 Comment : Thank you for downloading our sample mp4 video.
- To change the metadata for a field, use the following command syntax. This will change the Author field.
$ exiftool -Author="linuxconfig" video.mp4 1 image files updated
The output says an image file has been updated, since ExifTool is primarily used to work with images, but do not worry, it will also make changes to the video file.
- To clear the metadata for a field, just overwrite it with empty data. Here is how we would delete the Comment field.
$ exiftool -Comment= video.mp4 1 image files updated
- To clear the metadata for all fields in the video file, use the following syntax.
$ exiftool -all= video.mp4
In this tutorial, we saw how to get and change video metadata on a Linux system. This included a GUI method with VLC Media Player and a command line method with ExifTool. Filling out metadata is not a very common practice on video files, so you may often find these fields empty. Still, it can be a good way to attach important information to the file.