I can't get MediaInfo to output the layout I want, no matter what I try, and I've searched far and wide, and the documentation is extremely scarce, and the development seems to have stalled for years in key areas. In particular, the author(s?) seems to acknowledge that the CLI mode with custom templates is but a rudimentary draft that was never finished, and may never be as it's not “sponsored” and thus has a very low priority. While on the GUI front the custom settings area for tree / text modes has only displayed an aggravating “not yet...” message for years.
MediaInfo GUI outputs this :
I want the precise size in bytes, and the precise duration, at least down to the seconds (in this case the seconds are displayed but when a file's duration is more than 1 hour, only the minutes are displayed which is not nearly accurate enough, and there are still no option to change the default layout, something which must have been requested a gazillion and a half times).Code:Général Identifiant unique : 239089836082144755665246587473294677130 (0xB3DF0708559F7A36BBB995CD646E548A) Nom complet : T:\ZA Saint Seiya ST Eng\[ZA].Saint.Seiya.Episode.001.DVDrip.[X264.AAC(Jpn-Fre).Sub(Fre-Eng).Chap].mkv Format : Matroska Version du format : Version 2 Taille du fichier : 180 Mio Durée : 24 min 21s Débit global moyen : 1 036 kb/s Nom du film : Saint Seiya - Episode 001 Date d'encodage : UTC 2010-12-26 06:48:54 Application utilisée : mkvmerge v3.1.0 ('Happy up here') built on Jan 19 2010 12:09:24 Bibliothèque utilisée : libebml v0.7.9 + libmatroska v0.8.1 Attachments : Andy.ttf / augie.ttf / bluehigh_cellphone_msv.ttf / Bolide-Regular.ttf / CronosPro-Bold.ttf / CronosPro-Semibold.ttf / CronosPro-SemiboldIt.ttf / Diamond_Fantasy.ttf / 001mini.bmp / Bolide_Regular.ttf Vidéo ID : 1 Format : AVC Format/Info : Advanced Video Codec Profil du format : High@L5.1 Paramètres du format : CABAC / 16 Ref Frames Paramètres du format, CABAC : Oui Paramètres du format, RefFrames : 16 images Identifiant du codec : V_MPEG4/ISO/AVC Durée : 24 min 21s Débit nominal : 900 kb/s Largeur : 720 pixels Hauteur : 544 pixels Format à l'écran : 4/3 Type d'images/s : Constant Images par seconde : 23,976 (23976/1000) Im/s Espace de couleurs : YUV Sous-échantillonnage de la chrominance : 4:2:0 Profondeur des couleurs : 8 bits Type de balayage : Progressif Bits/(Pixel*Image) : 0.096 Bibliothèque utilisée : x264 core 54 svn-618 Paramètres d'encodage : cabac=1 / ref=16 / deblock=1:2:2 / analyse=0x3:0x133 / me=umh / subme=6 / brdo=1 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=0 / threads=1 / nr=0 / decimate=1 / mbaff=0 / bframes=2 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=2 / wpredb=1 / bime=1 / keyint=300 / keyint_min=25 / scenecut=30 / rc=2pass / bitrate=900 / ratetol=1.0 / rceq='blurCplx^(1-qComp)' / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.20 / pb_ratio=1.30 Langue : Japonais Default : Oui Forced : Non Audio #1 ID : 2 Format : AAC LC SBR Format/Info : Advanced Audio Codec Low Complexity with Spectral Band Replication Nom commercial : HE-AAC Paramètres du format : Explicit Identifiant du codec : A_AAC-2 Durée : 24 min 21s Canaux : 2 canaux Channel layout : L R Echantillonnage : 48,0 kHz Images par seconde : 23,438 Im/s (2048 SPF) Mode de compression : Avec perte Langue : Japonais Default : Oui Forced : Non Audio #2 ID : 5 Format : AAC LC SBR Format/Info : Advanced Audio Codec Low Complexity with Spectral Band Replication Nom commercial : HE-AAC Paramètres du format : Explicit Identifiant du codec : A_AAC-2 Durée : 24 min 21s Canaux : 2 canaux Channel layout : L R Echantillonnage : 48,0 kHz Images par seconde : 23,438 Im/s (2048 SPF) Mode de compression : Avec perte Langue : Français Default : Non Forced : Non Texte #1 ID : 3 Format : ASS Identifiant du codec : S_TEXT/ASS Identifiant du codec/Info : Advanced Sub Station Alpha Mode de compression : Sans perte Titre : Sub avec Θdition (ASS) Langue : Français Default : Non Forced : Non Texte #2 ID : 4 Format : UTF-8 Identifiant du codec : S_TEXT/UTF8 Identifiant du codec/Info : UTF-8 Plain Text Titre : Sub sans Θdition (SRT) Langue : Français Default : Non Forced : Non Texte #3 ID : 6 Format : UTF-8 Identifiant du codec : S_TEXT/UTF8 Identifiant du codec/Info : UTF-8 Plain Text Titre : ScΦnes censurΘes Default : Non Forced : Non Texte #4 ID : 7 Format : ASS Identifiant du codec : S_TEXT/ASS Identifiant du codec/Info : Advanced Sub Station Alpha Mode de compression : Sans perte Titre : Soft style subtitle [By: D-YFI] Langue : Anglais Default : Oui Forced : Non Menu 00:00:00.000 : fr:1. Opening (Pegasus Fantasy) 00:01:25.440 : fr:2. Introduction 00:02:19.200 : fr:3. Revivez ! Les héros légendaires 00:02:26.200 : fr:4. Première partie 00:11:52.500 : fr:5. Eyecatch 00:12:01.600 : fr:6. Deuxième partie 00:22:41.500 : fr:7. Ending (Blue Forever) 00:23:51.500 : fr:8. Prochain épisode
Using MediaInfo CLI and this template (I spent hours last night trying to figure out why it didn't work at first, since there was no warning whatsoever I wasn't even sure if it came from the command's syntax or the template, turned out that accentuated characters, which are très fréquents in french, aren't recognized in custom templates, although obviously there's no such problem with the GUI version) :
Gives this output :Code:General;General\r\nFile name : %CompleteName%\r\nUnique ID : %UniqueID%\r\nFile size : %FileSize%\r\nDuration : %Duration_String3%\r\nOverall average bitrate : %OverallBitRate_String%\r\nTitle : %Title%\r\nCreation date : %File_Created_Date%\r\nModification date : %File_Modified_Date%\r\nEncoded date : %Encoded_Date%\r\nFormat : %Format%\r\nFormat version : %Format_Version%\r\nEncoding application : %Encoded_Application%\r\nEncoding library : %Encoded_Library%\r\nAttachments : %Other_Format_List%\r\n\r\n Video;Video\r\nTrack ID : %ID%\r\nFormat : %Format% (%Format_Commercial%)\r\nFormat / info : %Format/Info%\r\nFormat profile : %Format_Profile%\r\nFormat settings : %Format_Settings%\r\nFormat settings / CABAC : %Format_Settings_CABAC%\r\nFormat settings / RefFrames : %Format_Settings_RefFrames%\r\nMuxing mode : %MuxingMode%\r\nCodec ID : %CodecID%\r\nDuration : %Duration/String3%\r\nNominal bitrate : %BitRate_Nominal_String%\r\nFrame size : %Width% x %Height%\r\nDisplay aspect ratio : %DisplayAspectRatio%\r\nFramerate : %FrameRate%\r\nFramerate mode : %FrameRate_Mode/String%\r\nColorspace : %ColorSpace%\r\nBit depth : %BitDepth/String%\r\nChroma subsampling : %ChromaSubsampling%\r\nScan type : %ScanType%\r\nBits/(Pixel*Image) : %Bits-(Pixel*Frame)%\r\nEncoding library : %Encoded_Library%\r\nEncoding settings : %Encoded_Library_Settings%\r\nColor primaries : %Colour_Primaries%\r\nTransfer characteristics : %Transfer_Characteristics%\r\nMatrix coefficients : %Matrix_Coefficients%\r\n\r\n Audio;Audio #%StreamKindID%\r\nTrack ID : %ID%\r\nFormat : %Format% (%Format_Commercial%)\r\nFormat / info : %Format/Info%\r\nFormat version : %Format_Version%\r\nFormat profile : %Format_Profile%\r\nFormat settings / SBR : %Format_Settings_SBR/String%\r\nFormat settings / PS : %Format_Settings_PS%\r\nCodec ID : %CodecID%\r\nDuration : %Duration/String3%\r\nChannel(s) : %Channel(s)%\r\nChannel positions : %ChannelPositions%\r\nChannel layout : %ChannelLayout%\r\nSampling rate : %SamplingRate%\r\nBit depth : %BitDepth_Stored%\r\nLanguage : %Language/String%\r\nTitle : %Title%\r\nDefault : %Forced%\r\nForced : %Default%\r\n\r\n Text;Text #%StreamKindID%\r\nTrack ID : %ID%\r\nFormat : %Format%\r\nFormat ID : %CodecID%\r\nFormat ID / info : %CodecID/Info%\r\nLanguage : %Language/String%\r\nTitle : %Title%\r\nDefault : %Forced%\r\nForced : %Default%\r\n\r\n
Some fields stay empty, probably because there's no corresponding information to extract, most of those aren't important anyway. But the “attachments” line should be populated, as it is on the GUI output. And I can't get it to display the chapters, I've tried every single field listed with “--info-parameters”, to no avail. Yet if I output every single field available with “mediainfo.exe -f”, the chapters are there. What am I missing ?Code:G:\>"C:\Logiciels autonomes\MediaInfo_CLI_21.09_Windows_x64\MediaInfo.exe" --Output=file://"C:\Logiciels autonomes\MediaInfo_CLI_21.09_Windows_x64\Plugin\Custom \Modif5c.csv" "T:\ZA Saint Seiya ST Eng\[ZA].Saint.Seiya.Episode.001.DVDrip.[X264.AAC(Jpn-Fre).Sub(Fre-Eng).Chap].mkv" General File name : T:\ZA Saint Seiya ST Eng\[ZA].Saint.Seiya.Episode.001.DVDrip.[X264.AAC(Jpn-Fre).Sub(Fre-Eng).Chap].mkv Unique ID : 239089836082144755665246587473294677130 File size : 189169176 Duration : 00:24:21.420 Overall average bitrate : 1 036 kb/s Title : Saint Seiya - Episode 001 Creation date : UTC 2015-09-23 13:42:54.140 Modification date : UTC 2015-09-23 13:54:51.531 Encoded date : UTC 2010-12-26 06:48:54 Format : Matroska Format version : Version 2 Encoding application : mkvmerge v3.1.0 ('Happy up here') built on Jan 19 2010 12:09:24 Encoding library : libebml v0.7.9 + libmatroska v0.8.1 Attachments : Video Track ID : 1 Format : AVC (AVC) Format / info : Advanced Video Codec Format profile : High@L5.1 Format settings : CABAC / 16 Ref Frames Format settings / CABAC : Yes Format settings / RefFrames : 16 Muxing mode : Codec ID : V_MPEG4/ISO/AVC Duration : 00:24:21.420 Nominal bitrate : 900 kb/s Frame size : 720 x 544 Display aspect ratio : 1.324 Framerate : 23.976 Framerate mode : Constant Colorspace : YUV Bit depth : 8 bits Chroma subsampling : 4:2:0 Scan type : Progressive Bits/(Pixel*Image) : 0.096 Encoding library : x264 - core 54 svn-618 Encoding settings : cabac=1 / ref=16 / deblock=1:2:2 / analyse=0x3:0x133 / me=umh / subme=6 / brdo=1 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=0 / threads=1 / nr=0 / decimate=1 / mbaff=0 / bframes=2 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=2 / wpredb=1 / bime=1 / keyint=300 / keyint_min=25 / scenecut=30 / rc=2pass / bitrate=900 / ratetol=1.0 / rceq='blurCplx^(1-qComp)' / qcomp=0.60 / qpmin= 10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.20 / pb_ratio=1.30 Color primaries : Transfer characteristics : Matrix coefficients : Audio #0 Track ID : 2 Format : AAC (HE-AAC) Format / info : Advanced Audio Codec Low Complexity with Spectral Band Replication Format version : Format profile : Format settings / SBR : Yes (Explicit) Format settings / PS : No (Explicit) Codec ID : A_AAC-2 Duration : 00:24:21.420 Channel(s) : 2 Channel positions : Front: L R Channel layout : L R Sampling rate : 48000 Bit depth : Language : Japanese Title : Default : No Forced : Yes Audio #1 Track ID : 5 Format : AAC (HE-AAC) Format / info : Advanced Audio Codec Low Complexity with Spectral Band Replication Format version : Format profile : Format settings / SBR : Yes (Explicit) Format settings / PS : No (Explicit) Codec ID : A_AAC-2 Duration : 00:24:21.420 Channel(s) : 2 Channel positions : Front: L R Channel layout : L R Sampling rate : 48000 Bit depth : Language : French Title : Default : No Forced : No Text #0 Track ID : 3 Format : ASS Format ID : S_TEXT/ASS Format ID / info : Advanced Sub Station Alpha Language : French Title : Sub avec Ødition (ASS) Default : No Forced : No Text #1 Track ID : 4 Format : UTF-8 Format ID : S_TEXT/UTF8 Format ID / info : UTF-8 Plain Text Language : French Title : Sub sans Ødition (SRT) Default : No Forced : No Text #2 Track ID : 6 Format : UTF-8 Format ID : S_TEXT/UTF8 Format ID / info : UTF-8 Plain Text Language : Title : ScFnes censurØes Default : No Forced : No Text #3 Track ID : 7 Format : ASS Format ID : S_TEXT/ASS Format ID / info : Advanced Sub Station Alpha Language : English Title : Soft style subtitle [By: D-YFI] Default : No Forced : Yes
+ Reply to Thread
Results 1 to 9 of 9
-
Last edited by abolibibelot; 2nd Oct 2021 at 18:49.
-
Code:
mediainfo --inform=Video;%Duration/String1% "filename.mp4" 1h 24mn 29s 440ms
-
For a list of parameters:
Code:mediainfo --info-parameters
-
jagabo... Very good information. The original text had several pages to make useage easier. I have uploaded a version to my dropbox which contains:
1. The Command Line Options
2. Command Line Examples
3. Creating Templates
4. Using the CLI Output in Batch Processing
5. Batch Processing Example
6. Color coded Entries for areas (General, Video, Audio, text, image, menu)
The link is :
https://www.dropbox.com/scl/fi/9xu57zrf723kh08ehkssd/CLI_Help.doc?dl=0&rlkey=ydj1o2ewi...nv1yrx6hn11w4t -
Well, thanks for these replies, but I don't think that it adresses the issue at hand...
What I asked was : with the CLI version, how to get at least all the information obtained with the GUI version, in particular the list of attachments and the list of chapters ? These informations do appear in the full report (mediainfo -f), but I can't find the corresponding options in the full list of parameters (which I already dumped as a text file -- not so convenient indeed but seems thorough) to add them selectively and get a streamlined report, non cluttered with redundant or irrelevant information. I searched in the list of parameters with the keyword “attach”, nothing. For the menu I tried every single option, nothing useful.
(Funny [or not-so-funny] thing is, this is a task I had first attempted on 16 December 2015, and quickly abandoned after an evening of fiddling, for I could not get the intended result.) -
So, to answer my own question (at least part of it) : no, it is currently not possible to get the list of chapters with MediaInfo CLI and a custom template.
https://github.com/optio50/Mediainfo-Template
https://sourceforge.net/p/mediainfo/discussion/297610/thread/9182ad3d06/
This is currently not possible, the template engine has a flaw here.
It is planned to update it, but currently not a priority.
So, is there any way to tweak the default output in order to get the precise size in bytes and the precise duration ? -
There is a new option BetterMediaInfo. It can show the precise duration by default.
[Attachment 82191 - Click to enlarge]
Similar Threads
-
Get-MediaInfo - a complete PowerShell MediaInfo solution
By stax76 in forum ProgrammingReplies: 6Last Post: 31st Mar 2021, 05:41 -
Is it possible to increase dvd display size without reencode?
By spiritgumm in forum Video ConversionReplies: 27Last Post: 6th Dec 2020, 11:42 -
Puzzling Subtitle Display Size Inconsistency
By EmmB in forum SubtitleReplies: 5Last Post: 11th Oct 2020, 21:49 -
Replicate Avi display size, codec from existing file?
By chrisino in forum Video ConversionReplies: 4Last Post: 4th Nov 2018, 08:23 -
Interlaced Audio Duration Longer than Video Duration (lip-sync issue)
By senlab in forum Video ConversionReplies: 7Last Post: 27th Aug 2018, 15:36