Regex or defined

All about user-defined episode / movie format expressions
Post Reply
devster
Posts: 332
Joined: 06 Jun 2017, 22:56

Regex or defined

Post by devster » 22 Apr 2019, 00:55

I'm still working on audio naming because of the new MediaInfo version.
I'd like to assign "Atmos" to a variable in case
1. Format_Commercial has "atmos" case-insensitive
2. NumberOfDynamicObjects is defined

the below is what I have, but it doesn't seem to work when one is undefined.

Code: Select all

def atmos = (audio["Format_Commercial"] =~ /(?i:atmos)/) ? "Atmos" : null
def atm = (audio["NumberOfDynamicObjects"]) ? "Atmos" : null
I only work in black and sometimes very, very dark grey. (Batman)

User avatar
rednoah
The Source
Posts: 16434
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Regex or defined

Post by rednoah » 22 Apr 2019, 03:17

Can you also copy & paste the MediaInfo audio table for your test file please?
:idea: Please read the FAQ and How to Request Help.

devster
Posts: 332
Joined: 06 Jun 2017, 22:56

Re: Regex or defined

Post by devster » 22 Apr 2019, 08:38

Code: Select all

Format	MLP FBA
Format_AdditionalFeatures	16-ch
Format_Commercial	Dolby TrueHD with Dolby Atmos
Format_Commercial_IfAny	Dolby TrueHD with Dolby Atmos
Format/Info	Meridian Lossless Packing FBA with 16-channel presentation
Format/String	MLP FBA 16-ch
FrameRate	1200.000
FrameRate/String	1 200.000 FPS (40 SPF)
NumberOfDynamicObjects	15
Number of Dynamic Objects isn't always defined, hence the issue.

The snippet would go in this context:

Code: Select all

{ import java.math.RoundingMode
        // audio map, some of these are probably not needed anymore
        def mCFP = [
          "FLAC" : "FLAC",
          "PCM" : "PCM",
          "MP3": "MP3",
          "AC-3": "AC-3",
          "AAC LC": "AAC LC",
          "E-AC-3 JOC": "E-AC-3",
          "DTS ES XXCH": "DTS-ES Discrete",
          "DTS XLL": "DTS-HD MA",
          "DTS XLL X": "DTS\u02D0X", // IPA triangular colon
          "DTS XBR": "DTS-HR",
          "MLP FBA": "TrueHD",
          "MLP FBA 16-ch": "TrueHD"
        ]
        audio.collect { au ->
          /* Format seems to be consistently defined
             Format_Profile and Format_AdditionalFeatures instead
             seem to be usually mutually exclusive
             Format_Commercial (and _If_Any variant) seem to be defined
             mainly for Dolby/DTS formats */
          def _ac = any{allOf{ au["Format"] }{ au["Format_Profile"] }{ au["Format_AdditionalFeatures"] }}{ au["Format_Commercial"] }.join(" ")
          def atmos = (au["Format_Commercial"] =~ /(?i:atmos)/) ? "Atmos" : null
          def atm = (au["NumberOfDynamicObjects"]) ? "Atmos" : null
          def _channels = any{ au["ChannelPositions/String2"] }{ au["Channel(s)_Original"] }{ au["Channel(s)"] }
          def ch = _channels =~ /^(?i:object.based)$/ ? 'Object Based' :
                   _channels.tokenize("\\/").take(3)*.toDouble()
                            .inject(0, { a, b -> a + b }).findAll { it > 0 }.max()
                            .toBigDecimal().setScale(1, RoundingMode.HALF_UP).toString()
          def stream = allOf
            { allOf{ ch }{ au["NumberOfDynamicObjects"] + "obj" }.join("+") }
            { allOf{ mCFP.get(_ac, _ac) }{atmos}.join("+") }
            { Language.findLanguage(au["Language"]).ISO3.upperInitial() }
          def ret = [:]
          /* this is done to retain stream order */
          ret.id = any{ au["StreamKindId"] }{ au["StreamKindPos"] }{ au["ID"] }
          ret.data = stream
          return ret
        }.toSorted{ it.id }.collect{ it.data }*.join(" ").join(", ") }
I only work in black and sometimes very, very dark grey. (Batman)

User avatar
rednoah
The Source
Posts: 16434
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Regex or defined

Post by rednoah » 22 Apr 2019, 09:00

This should work:

Code: Select all

{
	def isAtmos1 = any{audio.FormatCommercial =~ /(?i)atmos/}{false}
	def isAtmos2 = any{audio.NumberOfDynamicObjects}{false}
	return isAtmos1 && isAtmos2
}
:idea: The key concept is that audio.XYZ won't return null or empty List, and instead will unwind (i.e. throw an Exception) and so you have to catch that error case.
:idea: Please read the FAQ and How to Request Help.

devster
Posts: 332
Joined: 06 Jun 2017, 22:56

Re: Regex or defined

Post by devster » 22 Apr 2019, 09:15

Thanks.
Comments in the above contain some observation on MediaInfo 18.12 bindings and when they're defined.
Unfortunately the situation changed a bit from 17.12 but Format is generally always there. Format_Profile and AdditionalFeatures seem mutually exclusive. Format/String seems to concatenate these.
Codec_Profile and CodecID are almost never present, and there are MP3 files where there is not a single field saying "MP3". Most of the other bindings didn't seem to change.
I only work in black and sometimes very, very dark grey. (Batman)

User avatar
rednoah
The Source
Posts: 16434
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Regex or defined

Post by rednoah » 22 Apr 2019, 10:02

Please keep me posted on MediaInfo compatibility changes.

Depending on your situation, you can easily replace MediaInfo.dll with an older or newer versions depending on what works for you. Reporting these findings to the MediaInfo project is helpful too.
:idea: Please read the FAQ and How to Request Help.

devster
Posts: 332
Joined: 06 Jun 2017, 22:56

Re: Regex or defined

Post by devster » 26 Apr 2019, 00:54

Finally found a possible solution.
https://github.com/MediaArea/MediaInfoLib/blob/master/Changes.txt
18.05 -> 18.08
- AC-3/DTS/AAC: display of info about legacy decoders behavior removed, use --LegacyStreamDisplay=1 for old behavior
- AC-3/DTS/AAC: New terminology for format name, use --File_HighestFormat=0 for old behavior
- Audio channel layout: using a new terminology, use --File_ChannelLayout=1 for old behavior
- Deprecated fields disabled by default, use --Legacy=1 for old behavior
I'll play around a bit but it seems with these bindings everything should work as before.
I only work in black and sometimes very, very dark grey. (Batman)

kim
Power User
Posts: 798
Joined: 15 May 2014, 16:17

Re: Regex or defined

Post by kim » 26 Apr 2019, 21:16

Same output as before ?

Code: Select all

MediaInfo.exe %FILE% --Language=raw -f --Legacy=1 --File_HighestFormat=0 --LegacyStreamDisplay=1 --File_ChannelLayout=1
Restores:
Format_Profile: e.g. X / MA / Core (new: NA)
BitRate: e.g. 4965852 / 4965852 / 1509000 (new: 4965852)
Channel(s): e.g. Object Based / 8 / 6 (new: 8)
ChannelPositions/String2: e.g. Object Based / 3/2/2.1 / 3/2/0.1 (new: Object Based)
Codec: e.g. MLP FBA
Codec/String: e.g. MLP FBA

BUT it does not fix e.g. :
Format: "MLP FBA" to "TrueHD"


MediaInfo --info-parameters

Code: Select all

Audio 
Count                     : Count of objects available in this stream
Status                    : bit field (0=IsAccepted, 1=IsFilled, 2=IsUpdated, 3=IsFinished)
StreamCount               : Count of streams of that kind available
StreamKind                : Stream type name
StreamKind/String         : Stream type name
StreamKindID              : Number of the stream (base=0)
StreamKindPos             : When multiple streams, number of the stream (base=1)
StreamOrder               : Stream order in the file, whatever is the kind of stream (base=0)
FirstPacketOrder          : Order of the first fully decodable packet met in the file, whatever is the kind of stream (base=0)
Inform                    : Last **Inform** call
ID                        : The ID for this stream in this file
ID/String                 : The ID for this stream in this file
OriginalSourceMedium_ID   : The ID for this stream in the original medium of the material
OriginalSourceMedium_ID/S : The ID for this stream in the original medium of the material
UniqueID                  : The unique ID for this stream, should be copied with stream copy
UniqueID/String           : The unique ID for this stream, should be copied with stream copy
MenuID                    : The menu ID for this stream in this file
MenuID/String             : The menu ID for this stream in this file
Format                    : Format used
Format/String             : Format used + additional features
Format/Info               : Info about the format
Format/Url                : Homepage of this format
Format_Commercial         : Commercial name used by vendor for theses setings or Format field if there is no difference
Format_Commercial_IfAny   : Commercial name used by vendor for theses setings if there is one
Format_Version            : Version of this format
Format_Profile            : Profile of the Format (old XML: '[email protected]' format
Format_Level              : Level of the Format (only MIXML)
Format_Compression        : Compression method used
Format_Settings           : Settings needed for decoder used, summary
Format_Settings_SBR 
Format_Settings_SBR/String 
Format_Settings_PS 
Format_Settings_PS/String 
Format_Settings_Mode 
Format_Settings_ModeExtension 
Format_Settings_Emphasis 
Format_Settings_Floor 
Format_Settings_Firm 
Format_Settings_Endianness 
Format_Settings_Sign 
Format_Settings_Law 
Format_Settings_ITU 
Format_Settings_Wrapping  : Wrapping mode (Frame wrapped or Clip wrapped)
Format_AdditionalFeatures : Format features needed for fully supporting the content
Matrix_Format             : Matrix format (e.g. DTS Neural)
InternetMediaType         : Internet Media Type (aka MIME Type, Content-Type)
MuxingMode                : How this stream is muxed in the container
MuxingMode_MoreInfo       : More info (text) about the muxing mode
CodecID                   : Codec ID (found in some containers)
CodecID/String            : Codec ID (found in some containers)
CodecID/Info              : Info about codec ID
CodecID/Hint              : Hint/popular name for this codec ID
CodecID/Url               : Homepage for more details about this codec ID
CodecID_Description       : Manual description given by the container
Codec                     : Deprecated, do not use in new projects
Codec/String              : Deprecated, do not use in new projects
Codec/Family              : Deprecated, do not use in new projects
Codec/Info                : Deprecated, do not use in new projects
Codec/Url                 : Deprecated, do not use in new projects
Codec/CC                  : Deprecated, do not use in new projects
Codec_Description         : Deprecated, do not use in new projects
Codec_Profile             : Deprecated, do not use in new projects
Codec_Settings            : Deprecated, do not use in new projects
Codec_Settings_Automatic  : Deprecated, do not use in new projects
Codec_Settings_Floor      : Deprecated, do not use in new projects
Codec_Settings_Firm       : Deprecated, do not use in new projects
Codec_Settings_Endianness : Deprecated, do not use in new projects
Codec_Settings_Sign       : Deprecated, do not use in new projects
Codec_Settings_Law        : Deprecated, do not use in new projects
Codec_Settings_ITU        : Deprecated, do not use in new projects
Duration                  : Play time of the stream, in ms
Duration/String           : Play time in format : XXx YYy only, YYy omited if zero
Duration/String1          : Play time in format : HHh MMmn SSs MMMms, XX omited if zero
Duration/String2          : Play time in format : XXx YYy only, YYy omited if zero
Duration/String3          : Play time in format : HH:MM:SS.MMM
Duration/String4          : Play time in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available
Duration/String5          : Play time in format : HH:MM:SS.mmm (HH:MM:SS:FF)
Duration_FirstFrame       : Duration of the first frame if it is longer than others, in ms
Duration_FirstFrame/Strin : Duration of the first frame if it is longer than others, in format : XXx YYy only, YYy omited if zero
Duration_FirstFrame/Strin : Duration of the first frame if it is longer than others, in format : HHh MMmn SSs MMMms, XX omited if zero
Duration_FirstFrame/Strin : Duration of the first frame if it is longer than others, in format : XXx YYy only, YYy omited if zero
Duration_FirstFrame/Strin : Duration of the first frame if it is longer than others, in format : HH:MM:SS.MMM
Duration_FirstFrame/Strin : Play time in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available
Duration_FirstFrame/Strin : Play time in format : HH:MM:SS.mmm (HH:MM:SS:FF)
Duration_LastFrame        : Duration of the last frame if it is longer than others, in ms
Duration_LastFrame/String : Duration of the last frame if it is longer than others, in format : XXx YYy only, YYy omited if zero
Duration_LastFrame/String : Duration of the last frame if it is longer than others, in format : HHh MMmn SSs MMMms, XX omited if zero
Duration_LastFrame/String : Duration of the last frame if it is longer than others, in format : XXx YYy only, YYy omited if zero
Duration_LastFrame/String : Duration of the last frame if it is longer than others, in format : HH:MM:SS.MMM
Duration_LastFrame/String : Play time in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available
Duration_LastFrame/String : Play time in format : HH:MM:SS.mmm (HH:MM:SS:FF)
Source_Duration           : Source Play time of the stream, in ms
Source_Duration/String    : Source Play time in format : XXx YYy only, YYy omited if zero
Source_Duration/String1   : Source Play time in format : HHh MMmn SSs MMMms, XX omited if zero
Source_Duration/String2   : Source Play time in format : XXx YYy only, YYy omited if zero
Source_Duration/String3   : Source Play time in format : HH:MM:SS.MMM
Source_Duration/String4   : Source Play time in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available
Source_Duration/String5   : Source Play time in format : HH:MM:SS.mmm (HH:MM:SS:FF)
Source_Duration_FirstFram : Source Duration of the first frame if it is longer than others, in ms
Source_Duration_FirstFram : Source Duration of the first frame if it is longer than others, in format : XXx YYy only, YYy omited if zero
Source_Duration_FirstFram : Source Duration of the first frame if it is longer than others, in format : HHh MMmn SSs MMMms, XX omited if zero
Source_Duration_FirstFram : Source Duration of the first frame if it is longer than others, in format : XXx YYy only, YYy omited if zero
Source_Duration_FirstFram : Source Duration of the first frame if it is longer than others, in format : HH:MM:SS.MMM
Source_Duration_FirstFram : Source Duration of the first frame if it is longer than others, in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available
Source_Duration_FirstFram : Source Duration of the first frame if it is longer than others, in format : HH:MM:SS.mmm (HH:MM:SS:FF)
Source_Duration_LastFrame : Source Duration of the last frame if it is longer than others, in ms
Source_Duration_LastFrame : Source Duration of the last frame if it is longer than others, in format : XXx YYy only, YYy omited if zero
Source_Duration_LastFrame : Source Duration of the last frame if it is longer than others, in format : HHh MMmn SSs MMMms, XX omited if zero
Source_Duration_LastFrame : Source Duration of the last frame if it is longer than others, in format : XXx YYy only, YYy omited if zero
Source_Duration_LastFrame : Source Duration of the last frame if it is longer than others, in format : HH:MM:SS.MMM
Source_Duration_LastFrame : Source Duration of the last frame if it is longer than others, in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available
Source_Duration_LastFrame : Source Duration of the last frame if it is longer than others, in format : HH:MM:SS.mmm (HH:MM:SS:FF)
BitRate_Mode              : Bit rate mode (VBR, CBR)
BitRate_Mode/String       : Bit rate mode (Constant, Variable)
BitRate                   : Bit rate in bps
BitRate/String            : Bit rate (with measurement)
BitRate_Minimum           : Minimum Bit rate in bps
BitRate_Minimum/String    : Minimum Bit rate (with measurement)
BitRate_Nominal           : Nominal Bit rate in bps
BitRate_Nominal/String    : Nominal Bit rate (with measurement)
BitRate_Maximum           : Maximum Bit rate in bps
BitRate_Maximum/String    : Maximum Bit rate (with measurement)
BitRate_Encoded           : Encoded (with forced padding) bit rate in bps, if some container padding is present
BitRate_Encoded/String    : Encoded (with forced padding) bit rate (with measurement), if some container padding is present
Channel(s)                : Number of channels
Channel(s)/String         : Number of channels (with measurement)
Channel(s)_Original       : Number of channels
Channel(s)_Original/Strin : Number of channels (with measurement)
Matrix_Channel(s)         : Number of channels after matrix decoding
Matrix_Channel(s)/String  : Number of channels after matrix decoding (with measurement)
ChannelPositions          : Position of channels
ChannelPositions/String2  : Position of channels (x/y.z format)
Matrix_ChannelPositions   : Position of channels after matrix decoding
Matrix_ChannelPositions/S : Position of channels after matrix decoding (x/y.z format)
ChannelLayout             : Layout of channels (in the stream)
ChannelLayoutID           : ID of layout of channels (e.g. MXF descriptor channel assignment). Warning, sometimes this is not enough for uniquely identifying a layout (e.g. MXF descriptor channel assignment is SMPTE 377-4). For AC-3, the form is x,y with x=acmod and y=lfeon.
SamplesPerFrame           : Sampling rate
SamplingRate              : Sampling rate
SamplingRate/String       : in KHz
SamplingCount             : Sample count (based on sampling rate)
Source_SamplingCount      : Source Sample count (based on sampling rate)
FrameRate                 : Frames per second
FrameRate/String          : Frames per second (with measurement)
FrameRate_Num             : Frames per second, numerator
FrameRate_Den             : Frames per second, denominator
FrameCount                : Frame count (a frame contains a count of samples depends of the format)
Source_FrameCount         : Source Frame count (a frame contains a count of samples depends of the format)
Resolution                : Deprecated, do not use in new projects
Resolution/String         : Deprecated, do not use in new projects
BitDepth                  : Resolution in bits (8, 16, 20, 24). Note: significant bits in case the stored bit depth is different
BitDepth/String           : Resolution in bits (8, 16, 20, 24). Note: significant bits in case the stored bit depth is different
BitDepth_Detected         : Detected (during scan of the input by the muxer) resolution in bits
BitDepth_Detected/String  : Detected (during scan of the input by the muxer) resolution in bits
BitDepth_Stored           : Stored Resolution in bits (8, 16, 20, 24)
BitDepth_Stored/String    : Stored Resolution in bits (8, 16, 20, 24)
Compression_Mode          : Compression mode (Lossy or Lossless)
Compression_Mode/String   : Compression mode (Lossy or Lossless)
Compression_Ratio         : Current stream size divided by uncompressed stream size
Delay                     : Delay fixed in the stream (relative) IN MS
Delay/String              : Delay with measurement
Delay/String1             : Delay with measurement
Delay/String2             : Delay with measurement
Delay/String3             : Delay in format : HH:MM:SS.MMM
Delay/String4             : Delay in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available
Delay/String5             : Delay in format : HH:MM:SS.mmm (HH:MM:SS:FF)
Delay_Settings            : Delay settings (in case of timecode for example)
Delay_DropFrame           : Delay drop frame
Delay_Source              : Delay source (Container or Stream or empty)
Delay_Source/String       : Delay source (Container or Stream or empty)
Delay_Original            : Delay fixed in the raw stream (relative) IN MS
Delay_Original/String     : Delay with measurement
Delay_Original/String1    : Delay with measurement
Delay_Original/String2    : Delay with measurement
Delay_Original/String3    : Delay in format: HH:MM:SS.MMM
Delay_Original/String4    : Delay in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available
Delay_Original/String5    : Delay in format : HH:MM:SS.mmm (HH:MM:SS:FF)
Delay_Original_Settings   : Delay settings (in case of timecode for example)
Delay_Original_DropFrame  : Delay drop frame info
Delay_Original_Source     : Delay source (Stream or empty)
Video_Delay               : Delay fixed in the stream (absolute / video)
Video_Delay/String 
Video_Delay/String1 
Video_Delay/String2 
Video_Delay/String3 
Video_Delay/String4 
Video_Delay/String5 
Video0_Delay              : Deprecated, do not use in new projects
Video0_Delay/String       : Deprecated, do not use in new projects
Video0_Delay/String1      : Deprecated, do not use in new projects
Video0_Delay/String2      : Deprecated, do not use in new projects
Video0_Delay/String3      : Deprecated, do not use in new projects
Video0_Delay/String4      : Deprecated, do not use in new projects
Video0_Delay/String5      : Deprecated, do not use in new projects
ReplayGain_Gain           : The gain to apply to reach 89dB SPL on playback
ReplayGain_Gain/String 
ReplayGain_Peak           : The maximum absolute peak value of the item
StreamSize                : Streamsize in bytes
StreamSize/String         : Streamsize in with percentage value
StreamSize/String1 
StreamSize/String2 
StreamSize/String3 
StreamSize/String4 
StreamSize/String5        : Streamsize in with percentage value
StreamSize_Proportion     : Stream size divided by file size
StreamSize_Demuxed        : StreamSize in bytes of hte stream after demux
StreamSize_Demuxed/String : StreamSize_Demuxed in with percentage value
StreamSize_Demuxed/String1 
StreamSize_Demuxed/String2 
StreamSize_Demuxed/String3 
StreamSize_Demuxed/String4 
StreamSize_Demuxed/String : StreamSize_Demuxed in with percentage value (note: theoritical value, not for real use)
Source_StreamSize         : Source Streamsize in bytes
Source_StreamSize/String  : Source Streamsize in with percentage value
Source_StreamSize/String1 
Source_StreamSize/String2 
Source_StreamSize/String3 
Source_StreamSize/String4 
Source_StreamSize/String5 : Source Streamsize in with percentage value
Source_StreamSize_Proport : Source Stream size divided by file size
StreamSize_Encoded        : Encoded Streamsize in bytes
StreamSize_Encoded/String : Encoded Streamsize in with percentage value
StreamSize_Encoded/String1 
StreamSize_Encoded/String2 
StreamSize_Encoded/String3 
StreamSize_Encoded/String4 
StreamSize_Encoded/String : Encoded Streamsize in with percentage value
StreamSize_Encoded_Propor : Encoded Stream size divided by file size
Source_StreamSize_Encoded : Source Encoded Streamsize in bytes
Source_StreamSize_Encoded : Source Encoded Streamsize in with percentage value
Source_StreamSize_Encoded/String1 
Source_StreamSize_Encoded/String2 
Source_StreamSize_Encoded/String3 
Source_StreamSize_Encoded/String4 
Source_StreamSize_Encoded : Source Encoded Streamsize in with percentage value
Source_StreamSize_Encoded : Source Encoded Stream size divided by file size
Alignment                 : How this stream file is aligned in the container
Alignment/String          : Where this stream file is aligned in the container
Interleave_VideoFrames    : Between how many video frames the stream is inserted
Interleave_Duration       : Between how much time (ms) the stream is inserted
Interleave_Duration/Strin : Between how much time and video frames the stream is inserted (with measurement)
Interleave_Preload        : How much time is buffered before the first video frame
Interleave_Preload/String : How much time is buffered before the first video frame (with measurement)
Title                     : Name of the track
Encoded_Application       : Name of the software package used to create the file, such as Microsoft WaveEdit
Encoded_Application/Strin : Name of the software package used to create the file, such as Microsoft WaveEdit, trying to have the format 'CompanyName ProductName (OperatingSystem) Version (Date)'
Encoded_Application_Compa : Name of the company
Encoded_Application_Name  : Name of the product
Encoded_Application_Versi : Version of the product
Encoded_Application_Url   : Name of the software package used to create the file, such as Microsoft WaveEdit.
Encoded_Library           : Software used to create the file
Encoded_Library/String    : Software used to create the file, trying to have the format 'CompanyName ProductName (OperatingSystem) Version (Date)'
Encoded_Library_CompanyNa : Name of the company
Encoded_Library_Name      : Name of the the encoding-software
Encoded_Library_Version   : Version of encoding-software
Encoded_Library_Date      : Release date of software
Encoded_Library_Settings  : Parameters used by the software
Encoded_OperatingSystem   : Operating System of encoding-software
Language                  : Language (2-letter ISO 639-1 if exists, else 3-letter ISO 639-2, and with optional ISO 3166-1 country separated by a dash if available, e.g. en, en-us, zh-cn)
Language/String           : Language (full)
Language/String1          : Language (full)
Language/String2          : Language (2-letter ISO 639-1 if exists, else empty)
Language/String3          : Language (3-letter ISO 639-2 if exists, else empty)
Language/String4          : Language (2-letter ISO 639-1 if exists with optional ISO 3166-1 country separated by a dash if available, e.g. en, en-us, zh-cn, else empty)
Language_More             : More info about Language (e.g. Director's Comment)
ServiceKind               : Service kind, e.g. visually impaired, commentary, voice over
ServiceKind/String        : Service kind (full)
Disabled                  : Set if that track should not be used
Disabled/String           : Set if that track should not be used
Default                   : Set if that track should be used if no language found matches the user preference.
Default/String            : Set if that track should be used if no language found matches the user preference.
Forced                    : Set if that track should be used if no language found matches the user preference.
Forced/String             : Set if that track should be used if no language found matches the user preference.
AlternateGroup            : Number of a group in order to provide versions of the same track
AlternateGroup/String     : Number of a group in order to provide versions of the same track
Encoded_Date              : UTC time that the encoding of this item was completed began.
Tagged_Date               : UTC time that the tags were done for this item.
Encryption 

User avatar
rednoah
The Source
Posts: 16434
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Regex or defined

Post by rednoah » 27 Apr 2019, 05:51

Interesting. Unfortunately, FileBot uses the C interface, and the command-line tool, so I'm not sure if setting Legacy=1 is even possible for FileBot. I'll look into it.
:idea: Please read the FAQ and How to Request Help.

User avatar
rednoah
The Source
Posts: 16434
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Regex or defined

Post by rednoah » 27 Apr 2019, 06:18

MediaInfo v19.04 has been released. Can I ask you guys to see how it works for your files, and if you recommend to upgrade to that one by default?
https://mediaarea.net/en/MediaInfo/Download/Windows

* You can just replace the *.dll or *.so native library in the FileBot install folder.
:idea: Please read the FAQ and How to Request Help.

devster
Posts: 332
Joined: 06 Jun 2017, 22:56

Re: Regex or defined

Post by devster » 27 Apr 2019, 13:49

I'm on Mac, are there updated versions of the command line tool?
Otherwise I believe I can swap out /Applications/FileBot.app/Contents/MacOS/libmediainfo.dylib with /usr/local/Cellar/media-info/19.04/lib/libmediainfo.dylib.

EDIT: nevermind, found the updated Cask, I could replace it there.
Any suggestion for a testing command? The below doesn't really work as well as I'd hoped.

Code: Select all

filebot -rename --action test [email protected]$HOME/Documents/projects/filebot-scripts/movieFormat.groovy ~/Movies/samples
filebot -list [email protected]$HOME/Documents/projects/filebot-scripts/movieFormat.groovy ~/Movies/samples --q 'Firefly'
I mean, is there a similar command to the "preview" of the GUI?
I only work in black and sometimes very, very dark grey. (Batman)

User avatar
rednoah
The Source
Posts: 16434
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Regex or defined

Post by rednoah » 27 Apr 2019, 17:18

You could use filebot -mediainfo with your custom --format to see how it works for different files.

If you're asking about more of an interactive mode, then you can try this:
viewtopic.php?f=3&t=4398
:idea: Please read the FAQ and How to Request Help.

devster
Posts: 332
Joined: 06 Jun 2017, 22:56

Re: Regex or defined

Post by devster » 27 Apr 2019, 18:25

FileBot installed via HomeBrew Cask
I'm a bit embarassed but the following happens:

Code: Select all

$ filebot -mediainfo ~/Movies/samples [email protected]/Users/devster/Documents/projects/filebot-scripts/movieFormat.groovy
@/Users/devster/Documents/projects/filebot-scripts/movieFormat.groovy
@/Users/devster/Documents/projects/filebot-scripts/movieFormat.groovy
...

OR

without =
$ filebot -mediainfo -r ~/Movies/samples --format @/Users/devster/Documents/projects/filebot-scripts/movieFormat.groovy
Illegal Argument: java.nio.file.NoSuchFileException: /Users/devster/Movies/  import java.math.RoundingMode (  import java.math.RoundingMode)
Illegal Argument: java.nio.file.NoSuchFileException: /Users/devster/Movies/  import groovy.json.JsonSlurper (  import groovy.json.JsonSlurper)
...
I only work in black and sometimes very, very dark grey. (Batman)

kim
Power User
Posts: 798
Joined: 15 May 2014, 16:17

Re: Regex or defined

Post by kim » 27 Apr 2019, 19:53

rednoah wrote:
27 Apr 2019, 06:18
MediaInfo v19.04 has been released. Can I ask you guys to see how it works for your files, and if you recommend to upgrade to that one by default?
https://mediaarea.net/en/MediaInfo/Download/Windows

* You can just replace the *.dll or *.so native library in the FileBot install folder.
how do I replace
C:\Program Files\WindowsApps\PointPlanck.FileBot_4.8.5.0_x64__49ex9gnthnt12\lib\MediaInfo.dll
without F*cking up the permissions ?

User avatar
rednoah
The Source
Posts: 16434
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Regex or defined

Post by rednoah » 27 Apr 2019, 19:54

Ah, if you're using the Mac App Store or Windows Store then you can't modify the app without breaking code signatures.

Hit me up for a universal license (PM name+email) so you can use the non-Store version.
:idea: Please read the FAQ and How to Request Help.

devster
Posts: 332
Joined: 06 Jun 2017, 22:56

Re: Regex or defined

Post by devster » 29 Apr 2019, 11:36

https://sourceforge.net/p/mediainfo/dis ... adf7116a65

Short summary
  • No binding is guaranteed to be defined
  • /Hint bindings are mainly reserved for non-technical details, and while sometimes they may contain "commercial" names for formats and codecs they're not really meant for that
  • Not much documentation about how bindings are generated is available for the moment as nobody was seriously interested in it
  • breaking changes were introduced "[...] to meet expectations of a sponsors, and also for "fixing" issues with our first implementation".
  • several video and audio codecs were affected but the bulk of changes was in "Dolby and DTS related stuff"
  • MLP FBA [...] is the technical name of TrueHD (a marketing name) recommended by Dolby, so it's likely here to stay
  • The code is [...] usable "as is" (as stipulated in the license), if you need more, including some customized information about change before a release and/or tests on your files, it is [possible](http://mediaarea.net/Services).
I only work in black and sometimes very, very dark grey. (Batman)

kim
Power User
Posts: 798
Joined: 15 May 2014, 16:17

Re: Regex or defined

Post by kim » 09 May 2019, 20:16

rednoah wrote:
27 Apr 2019, 05:51
Interesting. Unfortunately, FileBot uses the C interface, and the command-line tool, so I'm not sure if setting Legacy=1 is even possible for FileBot. I'll look into it.
does this help anything ?
https://github.com/MediaArea/MediaInfoL ... o.cpp#L153

Post Reply