How to install mediainfo v0.7.83 on unRAID 6.1.x


Recommended Posts

I wanted to be able to easily determine the resolution of a given video file from the command-line, and a quick Google search indicated that mediainfo was an ideal app for that. Unfortunately, installing it was not directly straightforward for someone used to RHEL/CentOS and new to Slackware so I'm posting my findings here for anyone else who may need them. I'm running 6.1.8 right now, but these directions would probably work for older or newer versions of unRAID as well as long as you're grabbing the right packages to start with (i686 vs x86_64) and putting the libraries in the correct path (/usr/lib vs /usr/lib64).

 

The only Slackware compatible mediainfo packages I could find on a Google search only included the mediainfo binary, which doesn't work without two other libraries. I found that there's a tool to convert rpm files to Slackware friendly tgz/txz files but couldn't get that to actually work. I ended up downloading the CentOS 7 rpms for mediainfo, libmediainfo0, and libzen0 from https://mediaarea.net/en-us/MediaInfo/Download/CentOS, manually extracting the files I needed using 7-zip on my Windows laptop, and copying them over to the server.

 

The three files you want are mediainfo, libmediainfo.so.0.0.0, and libzen.so.0.0.0. Put them in their respective paths and make sure they're owned by root. The mediainfo binary also needs to be made executable.

 

/usr/bin/mediainfo

/usr/lib64/libmediainfo.so.0.0.0

/usr/lib64/libzen.so.0.0.0

 

I'm not sure of the actual reason, but it appears that you need to create symlinks to those libs as follows:

 

ln -s /usr/lib64/libmediainfo.so.0.0.0 /usr/lib64/libmediainfo.so.0

ln -s /usr/lib64/libzen.so.0.0.0 /usr/lib64/libzen.so.0

 

And... that's it. mediainfo should now work.

 

root@tower:/mnt/user/video# mediainfo some_video_file.mkv
General
Unique ID                                : 247681507728423544442260658962280431492 (0xBA55B9264A56D87A33B0E16993E73F84)
Complete name                            : some_video_file.mkv
Format                                   : Matroska
Format version                           : Version 4 / Version 2
File size                                : 878 MiB
Duration                                 : 42mn 24s
Overall bit rate                         : 2 895 Kbps
Encoded date                             : UTC 2015-10-06 17:37:46
Writing application                      : mkvmerge v8.4.0 ('A better way to fly') 64bit
Writing library                          : libebml v1.3.1 + libmatroska v1.4.2

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : [email protected]
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 8 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 42mn 24s
Bit rate                                 : 2 509 Kbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.114
Stream size                              : 761 MiB (87%)
Writing library                          : x264 core 148 r2597 e86f3a1
Encoding settings                        : cabac=1 / ref=8 / deblock=1:-2:-2 / analyse=0x3:0x113 / me=umh / subme=9 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-2 / threads=18 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=5 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=crf / mbtree=1 / crf=18.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Language                                 : English
Default                                  : Yes
Forced                                   : No

Audio
ID                                       : 2
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Codec ID                                 : A_AC3
Duration                                 : 42mn 24s
Bit rate mode                            : Constant
Bit rate                                 : 384 Kbps
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 KHz
Frame rate                               : 31.250 fps (1536 spf)
Compression mode                         : Lossy
Stream size                              : 116 MiB (13%)
Default                                  : Yes
Forced                                   : No

 

You can then use grep to extract just the info you want or, ideally, use mediainfo's built-in commands for displaying specific data. e.g.:

 

root@tower:/mnt/user/video# mediainfo --Output="Video;%Width%x%Height%" some_video_file.mkv
1280x720

 

Pro-tip, if you're going to loop through a directory worth of files, make sure to put quotes around the variable at the end or it won't work for filenames with spaces (you'll just get no output from mediainfo).

 

incorrect: for i in *.m??; do echo $i; mediainfo --Output="Video;%Width%x%Height%" $i; done

correct: for i in *.m??; do echo $i; mediainfo --Output="Video;%Width%x%Height%" "$i"; done

 

I haven't created a .txz file for it yet, but may just do so if there's any interest (I'll need to look up how to properly make one, but I imagine it's pretty simple).

Link to comment
  • 4 weeks later...

Thanks for the info gilahacker,

 

I haven't tried it the info you provided yet but I will soon.  Mediainfo is a very useful tool.

 

The nerd tool plugin adds a lot of great command line tools including 7zip, so you can probably use it directly from unraid to install the required parts of Mediainfo.  Maybe someone could add Mediainfo and ffmpeg to the Nerd Tools plugin.  That would be sweet...

 

Cheers,

Nowhereman

Link to comment

Thanks for the info gilahacker,

 

I haven't tried it yet but I will soon.  Mediainfo is a very useful tool.  Maybe someone could add it and ffmpeg to the Nerd Tools plugin.  That would be sweet...

 

Cheers,

Nowhereman

 

NOTE: I noticed that my changes were gone after a reboot and I had to go through the steps to get it working again. I'm guessing I was making changes to the RAM drive that unRAID runs out of and I need to do something else to make them persistent on the flash, but haven't taken the time to try to figure that out yet.

 

Agreed regarding the Nerd Tools. That would be a far preferable way of installing this stuff and whatever it's doing its doing correctly because those packages survive a reboot.

Link to comment

The way to do it would be to place the files on your flash drive and copy them and do the symlinking via your go file which would make it appear persistent across reboots..

 

Sent from my LG-H815 using Tapatalk

Too nice a weekend (and too much liquid sustenance) for me to do that much detail

 

 

Sent from my LG-D852 using Tapatalk

 

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.