2

I'm using mediainfo to obtain several aspects of an input video such as resolution and framerate. I'm using the --inform option for that with values such as

"Video;%FrameRate%"

"Video;%Format/Info%"

However, i'm not being able to obtain the information on color range the same way. Running --info-parameters , i can see that the option i believe i should be using is

colour_range              : Colour range for YUV colour space

But trying mediainfo with that doesn't work, instead responding with an echo, as if it didn't recognize the setting

Here's some attempts i've done:

me@pc:~$ mediainfo --version
MediaInfo Command line, 
MediaInfoLib - v0.7.82
me@pc:~$ mediainfo video.mp4 --inform="Video;%Format/Info%"
High Efficiency Video Coding
me@pc:~$ mediainfo video.mp4 --inform="Video;%FrameRate%"
30.000
me@pc:~$ mediainfo video.mp4 --inform="Video;%FramRate%"

me@pc:~$ mediainfo video.mp4 --inform="Video;%colour_range%"
%colour_range%
me@pc:~$ mediainfo video.mp4 --inform="Video;%Colour_range%"

me@pc:~$ mediainfo video.mp4 --inform="Video;%somethingweird%"
%somethingweird%

I know for a fact that this video does have the metadata, because running plain mediainfo gives me:

{...}
Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
{...}
Color range                              : Full
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709
{...}

So right now i'm looking at the very serious possibility of just using plain mediainfo and grep to obtain what i want, but i'm wondering, maybe i'm just missing the correct name in mediainfo?

This is mediainfo 0.7.82 running on ubuntu 16.

Any tips would be appreciated

otiteb
  • 23
  • 4

1 Answers1

1

mediainfo video.mp4 --inform="Video;%colour_range%"

This is the expected command, so something was buggy in the version provided in Ubuntu 16.04, MediaInfo v0.7.82 is pretty old and no more supported upstream, you should update to a newer one, there are .deb files and also a repository for automatic updates at the MediaInfo Ubuntu dedicated page, MediaInfo 18.12 is available also for Ubuntu 16.04.

~$ more /etc/issue
Ubuntu 16.04.6 LTS \n \l
~$ mediainfo --version
MediaInfo Command line, 
MediaInfoLib - v0.7.82
~$ mediainfo test.265 --Inform="Video;%colour_range%"
%colour_range%
~$ wget https://mediaarea.net/repo/deb/repo-mediaarea_1.0-7_all.deb && sudo dpkg -i repo-mediaarea_1.0-7_all.deb && sudo apt-get update && sudo apt install mediainfo -y
[...]
Setting up mediainfo (18.12-1) ...
~$ mediainfo --version
MediaInfo Command line, 
MediaInfoLib - v18.12
~$ mediainfo test.265 --Inform="Video;%colour_range%"
Limited

Jérôme, developer of MediaInfo.

  • I see, thanks a lot for the pointer to the newer version! This works as expected. Out of curiosity Is there any particular reason why the default repository for ubuntu 16 keeps on delivering version 0.7.82? – otiteb Mar 15 '19 at 19:04
  • 1
    This is a common policy of distro maintainers to freeze the version of tools in a distro version. You can update the whole distro, including MediaInfo, by upgrading to Ubuntu 18.04 (the [MediaInfo version in Ubuntu 18.04](https://packages.ubuntu.com/bionic/mediainfo) is a bit old but less old and does not have this bug). – Jérôme Martinez Mar 16 '19 at 10:07