Mediainfo: How to obtain color range information?

1

1

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

Posted 2019-03-14T20:46:14.367

Reputation: 13

My other alternative is to go with a ffprobe -show_streams approach. That seems to work, but i'm still a bit puzzled with how to make it work in mediainfo – otiteb – 2019-03-14T21:05:35.360

Have you tried spelling "color" without the "U"? – Scott – 2019-03-15T00:50:21.567

yes, tried that as well, no luck. Also, --info-parameters did spell it with the u, the underscore, and the lower case – otiteb – 2019-03-15T01:27:10.820

Answers

0

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.

Jérôme Martinez

Posted 2019-03-14T20:46:14.367

Reputation: 301

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 – 2019-03-15T19:04:34.310

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 is a bit old but less old and does not have this bug).

– Jérôme Martinez – 2019-03-16T10:07:49.153