Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: DTS/Dolby Codec names in Foobar (Read 1682 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

DTS/Dolby Codec names in Foobar

Hi,

is it possible to see what exact format of DTS is being played with Foobar?
I have a column named Codec but it only shows DTS no matter what kind of DTS is being played - it would be nice if it showed DTSHDMA or DTS96/24 or others.
When I play Dolby - Foobar shows AC3 or TrueHD (do not know if it also shows others forms as I usually use those two) - would it be possible to display such info regarding DTS forms?
I have already tried $info(codec_profile) but it shows only DTS.

Re: DTS/Dolby Codec names in Foobar

Reply #1
Hi,

is it possible to see what exact format of DTS is being played with Foobar?
I have a column named Codec but it only shows DTS no matter what kind of DTS is being played - it would be nice if it showed DTSHDMA or DTS96/24 or others.
When I play Dolby - Foobar shows AC3 or TrueHD (do not know if it also shows others forms as I usually use those two) - would it be possible to display such info regarding DTS forms?
I have already tried $info(codec_profile) but it shows only DTS.


You can make use of $info(bitspersample) to determine if it is lossless or not.
DTS 96/24 not lossless or lossless is a bit of a problem, but I "fix" that by looking to overall bitrate. So anything smaller than 1537kbps bitrate is not lossless. Anything above is.

This bit of code I wrote before all kinds of changes were made in 2.0, 2.1 betas to handling different codec formats, but this code still works. No way to detect DTS:X though which is still identified as DTS-HD MA 7.1.

Have a look at the DTS/DTSHD or AC3/EAC relevant stuff and pick what works for you ...

Code: [Select]
$puts(MOD, --- CODE.SPECS ---)


$puts(cmt, INITIALIZE COMMON FULL SPECS)

$puts(specs_full.video_codec,[$upper($info(video_codec))])
$puts(specs_full.codec_long_name,[$info(codec_long_name)])

$puts(specs_full.codec,[$upper(%codec%)])
$puts(specs_full.codec_profile,[%codec_profile%])
$puts(specs_full.samplerate,[$div(%samplerate%,1000)])
$puts(specs_full.bitspersample,[$info(bitspersample)])
$puts(specs_full.bitrate,[%bitrate%])
$puts(specs_full.channels_num,[$info(channels)])
$puts(specs_full.encoding,[$info(encoding)])

$if($and($get(item.youtube),$stricmp($cut($get(specs_full.codec),3),COM)),
$puts(specs_full.codec,COM)
)

$if($get(specs_full.codec_long_name), $puts(specs_full.codec,$get(specs_full.codec_long_name)) )


$puts(cmt, PROCESS VIDEO CODEC FIRST)

$if($stricmp($substr($get(specs_full.video_codec),6,8),AVC),
$puts(specs_full.video_codec,x264) ,
$if($stricmp($get(specs_full.video_codec),CINEPAK),
$puts(specs_full.video_codec,CINEPK) ,
$if($or($stricmp($cut($get(specs_full.video_codec),5),H.264),$stricmp($substr($get(specs_full.video_codec),2,5),H264),$stricmp($substr($get(specs_full.video_codec),2,6),H.264)),
$puts(specs_full.video_codec,H264) ,
$if($stricmp($cut($get(specs_full.video_codec),5),H.265),
$puts(specs_full.video_codec,H265)
$if($stricmp($cut($get(specs_full.video_codec),5),MPEG1),
$puts(specs_full.video_codec,MPEG1) ,
$if($stricmp($cut($get(specs_full.video_codec),5),MPEG2),
$puts(specs_full.video_codec,MPEG2) ,
$if($stricmp($cut($get(specs_full.video_codec),6),MPEG-4),
$puts(specs_full.video_codec,MPEG4) ,
$if($stricmp($get(specs_full.video_codec),MS/VFW/FOURCC),
$puts(specs_full.video_codec,MSVFW) ,
$if($stricmp($cut($get(specs_full.video_codec),3),VC1),
$puts(specs_full.video_codec,VC1) ,
)))))))))

$puts(cmt, INITIALIZE COMMON CONDENSED SPECS)

$puts(specs_cond.samplerate,$get(specs_full.samplerate))
$puts(specs_cond.bitspersample,$get(specs_full.bitspersample))
$puts(specs_cond.channels_num,$get(specs_full.channels_num))
$puts(specs_cond.bitrate,$get(specs_full.bitrate))


$puts(cmt, CODEC SPECIFIC FULL/CONDENSED SPECS & CLEARING CONDENSED DEFAULTS)

$puts(cmt, Remap MKV --> DTS)
$if($stricmp($get(specs_full.codec),MKV),
$puts(specs_full.codec,DTS)
)

$puts(cmt, AAC default LC 44kHz 2ch)
$if($stricmp($cut($get(specs_full.codec),3),AAC),
$puts(specs_full.codec,AAC)
$ifequal($get(specs_full.codec_profile),LC,
$puts(specs_full.codec_profile,)
,)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, AC3 default 48kHz 640kbps@6ch)
$if($or($stricmp($get(specs_full.codec),AC3),$stricmp($cut($get(specs_full.codec),10),ATSC A/52A)),
$puts(specs_full.codec,AC3)
$ifequal($get(specs_full.samplerate),48, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),6,
$ifequal($get(specs_full.bitrate),640, $puts(specs_cond.bitrate,) ,)
,)
)

$puts(cmt, ADPCM default 44kHz 2ch)
$if($stricmp($cut($get(specs_full.codec),5),ADPCM),
$puts(specs_full.codec,ADPCM)
$puts(specs_full.bitspersample,)
$puts(specs_cond.bitspersample,)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, ALAC default 44kHz 16bit 2ch)
$if($stricmp($cut($get(specs_full.codec),4),ALAC),
$puts(specs_full.codec,ALAC)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.bitspersample),16, $puts(specs_cond.bitspersample,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, CDDA default 44kHz 16bit 2ch)
$if($stricmp($cut($get(specs_full.codec),4),CDDA),
$puts(specs_full.codec,CDDA)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.bitspersample),16, $puts(specs_cond.bitspersample,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, DTS default 48kHz 1509/1510/1536kbps)
$puts(cmt, DTS HD default 48kHz 16bit)
$if($or($stricmp($get(specs_full.codec),DTS),$stricmp($cut($get(specs_full.codec),3),DCA)),
$puts(specs_full.codec,DTS)
$ifequal($get(specs_full.samplerate),48, $puts(specs_cond.samplerate,) ,)
$if($get(specs_full.bitspersample),
$puts(specs_full.codec_profile,HD)
$ifequal($get(specs_full.bitspersample),16, $puts(specs_cond.bitspersample,) ,)
$puts(specs_full.encoding,lossless)
,
$puts(specs_full.encoding,lossy)
$ifequal($get(specs_full.samplerate),96,
,
$ifequal($get(specs_full.bitrate),1509, $puts(specs_cond.bitrate,) ,)
$ifequal($get(specs_full.bitrate),1510, $puts(specs_cond.bitrate,) ,)
$ifequal($get(specs_full.bitrate),1519, $puts(specs_cond.bitrate,) ,)
$ifequal($get(specs_full.bitrate),1536, $puts(specs_cond.bitrate,) ,)
)
)
)

$puts(cmt, EAC default 48kHz)
$if($or($stricmp($get(specs_full.codec),E-AC3),$stricmp($get(specs_full.codec),EAC3),$stricmp($cut($get(specs_full.codec),10),ATSC A/52B)),
$puts(specs_full.codec,EAC)
$ifequal($get(specs_full.samplerate),48, $puts(specs_cond.samplerate,) ,)
)

$puts(cmt, FLAC default 44kHz 16bit 2ch)
$if($stricmp($cut($get(specs_full.codec),4),FLAC),
$puts(specs_full.codec,FLAC)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.bitspersample),16, $puts(specs_cond.bitspersample,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, MAPE default 44kHz 16bit 2ch)
$if($stricmp($cut($get(specs_full.codec),3),Mon),
$puts(specs_full.codec,MAPE)
$puts(specs_full.codec_profile,)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.bitspersample),16, $puts(specs_cond.bitspersample,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, MP2 default 44kHz 2ch)
$if($stricmp($cut($get(specs_full.codec),3),MP2),
$puts(specs_full.codec,MP2)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, MP3 default 44kHz 2ch)
$if($stricmp($cut($get(specs_full.codec),3),MP3),
$puts(specs_full.codec,MP3)
$if($stricmp($cut($get(specs_full.codec_profile),3),VBR),
$puts(specs_full.codec_profile,$substr($get(specs_full.codec_profile),5,256))
$puts(specs_cond.bitrate,)
)
$if($stricmp($cut($get(specs_full.codec_profile),3),CBR),
$puts(specs_full.codec_profile,$get(specs_full.bitrate)$if($stricmp($info(mp3_stereo_mode),stereo),s,$if($stricmp($info(mp3_stereo_mode),joint stereo),js,)))
$puts(specs_cond.bitrate,)
)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, OPUS default 44kHz 2ch)
$if($stricmp($get(specs_full.codec),OPUS),
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, PCM default 44kHz 16bit 2ch)
$if($stricmp($cut($get(specs_full.codec),3),PCM),
$puts(specs_full.codec,PCM)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.bitspersample),16, $puts(specs_cond.bitspersample,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, QDM2 default 44kHz 2ch)
$if($or($stricmp($get(specs_full.codec),QDME2),$stricmp($get(specs_full.codec),QDesign Music Codec 2)),
$puts(specs_full.codec,QDM2)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, TrueHD default 48kHz 24bit)
$if($stricmp($get(specs_full.codec),TRUEHD),
$puts(specs_full.codec,TrueHD)
$ifequal($get(specs_full.samplerate),48, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.bitspersample),24, $puts(specs_cond.bitspersample,) ,)
)

$puts(cmt, Vorbis default 44kHz 2ch)
$if($stricmp($get(specs_full.codec),VORBIS),
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, WMA default 44kHz 2ch)
$if($stricmp($get(specs_full.codec),WMA),
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, WMAV2 default 44kHz 2ch)
$if($stricmp($get(specs_full.codec),WMAV2),
$puts(specs_full.codec,WMA)
$puts(specs_full.codec_profile,V2)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)


$puts(cmt, IN CASE NOT SET - SET ENCODING TO LOSSLESS/LOSSY BASED ON BITSPERSAMPLE)
$if($get(specs_full.encoding),
,
$if($get(specs_full.bitspersample),
$puts(specs_full.encoding,lossless)
,
$puts(specs_full.encoding,lossy)
)
)


$puts(cmt, HDCD PLAYING OR MEDIA TAG HDCD) $puts(cmt, OTHER HDCD vars: %__hdcd_peak_extend% %__hdcd_gain% TF: %__hdcd_transient_filter%)
$if($stricmp($get(specs_full.encoding),lossless),
$if($or($info(hdcd),$stricmp($meta(media),HDCD)),
$puts(overrule,1)
$if(%el_is_group%,
,
$if(%el_isplaying%,
$if($info(hdcd),
$ifequal($get(specs_full.bitspersample),24, $puts(specs_full.bitspersample,20) ,)
,
$puts(overrule,0)
)
)
)
$ifequal($get(overrule),1,
$puts(specs_full.codec,HDCD)
,)
)
)


$puts(cmt, SET FINAL CONDENSED CODEC/CODEC_PROFILE/BITRATE)
$puts(specs_cond.codec,$get(specs_full.codec))
$puts(specs_cond.codec_profile,$get(specs_full.codec_profile))
$if($stricmp($get(specs_full.codec),MP3),
$ifequal(%ROW.SPECS.MP3_CODEC%,        0, $puts(specs_cond.codec,) ,)
$ifequal(%ROW.SPECS.MP3_CODEC_PROFILE%,0, $puts(specs_cond.codec_profile,) ,)
$if($get(item.stream),
,
$ifequal(%ROW.SPECS.MP3_BITRATE%,0, $puts(specs_cond.bitrate,) ,)
)
)
$if($get(specs_cond.codec),
$puts(specs_cond.codec_txt,$get(specs_cond.codec)[-$get(specs_cond.codec_profile)])
,
$puts(specs_cond.codec_txt,[$get(specs_cond.codec_profile)])
)

$puts(cmt, SET FULL/CONDENSED SR_BPS_BR TXT - LOSSY: SAMPLERATE/BITRATE - LOSSLESS: SAMPLERATE/BITSPERSAMPLE)
$if($stricmp($get(specs_full.encoding),lossy),
$puts(specs_full.sr_bps_br,[$get(specs_full.samplerate)kHz])

$if($get(specs_cond.bitrate),
$puts(specs_cond.sr_bps_br,[$get(specs_cond.samplerate)/][$get(specs_cond.bitrate)kbps])
,
$puts(specs_cond.sr_bps_br,[$get(specs_cond.samplerate)kHz])
)
,
$puts(specs_full.sr_bps_br,$get(specs_full.samplerate)/$get(specs_full.bitspersample))
$if($or($get(specs_cond.samplerate),$get(specs_cond.bitspersample)),
$puts(specs_cond.sr_bps_br,$get(specs_full.sr_bps_br))
)
)

$puts(cmt, CLEAR 2ch CONDENSED CHANNELS_TXT IF CHOSEN)
$puts(specs_cond.channels_txt,[$get(specs_cond.channels_num)ch])
$ifequal(%ROW.SPECS.2CH%,0,
$ifequal($get(specs_cond.channels_num),2,
$puts(specs_cond.channels_txt,)
,)
,)

$puts(cmt, CREATE FULL/CONDENSED SPECS STRINGS)
$puts(specs_cond.txt,$replace($substr($ifgreater(%ROW.SPECS.VIDEO%, 0,[|$get(specs_full.video_codec)],)[|$get(specs_cond.codec_txt)][|$get(specs_cond.sr_bps_br)][|$get(specs_cond.channels_txt)],2,512),|,$get(delimiter)))
$puts(specs_full.txt,$replace($substr($ifgreater(%ROW.SPECS.VIDEO%,-1,[|$get(specs_full.video_codec)],)[|$get(specs_full.codec)[-$get(specs_full.codec_profile)]][|$get(specs_full.sr_bps_br)][|%channels%][|$get(specs_full.bitrate)kbps],2,512),|,$get(delimiter)))

Re: DTS/Dolby Codec names in Foobar

Reply #2
Hi,

is it possible to see what exact format of DTS is being played with Foobar?
I have a column named Codec but it only shows DTS no matter what kind of DTS is being played - it would be nice if it showed DTSHDMA or DTS96/24 or others.
When I play Dolby - Foobar shows AC3 or TrueHD (do not know if it also shows others forms as I usually use those two) - would it be possible to display such info regarding DTS forms?
I have already tried $info(codec_profile) but it shows only DTS.


You can make use of $info(bitspersample) to determine if it is lossless or not.
DTS 96/24 not lossless or lossless is a bit of a problem, but I "fix" that by looking to overall bitrate. So anything smaller than 1537kbps bitrate is not lossless. Anything above is.

This bit of code I wrote before all kinds of changes were made in 2.0, 2.1 betas to handling different codec formats, but this code still works. No way to detect DTS:X though which is still identified as DTS-HD MA 7.1.

Have a look at the DTS/DTSHD or AC3/EAC relevant stuff and pick what works for you ...

Code: [Select]
$puts(MOD, --- CODE.SPECS ---)


$puts(cmt, INITIALIZE COMMON FULL SPECS)

$puts(specs_full.video_codec,[$upper($info(video_codec))])
$puts(specs_full.codec_long_name,[$info(codec_long_name)])

$puts(specs_full.codec,[$upper(%codec%)])
$puts(specs_full.codec_profile,[%codec_profile%])
$puts(specs_full.samplerate,[$div(%samplerate%,1000)])
$puts(specs_full.bitspersample,[$info(bitspersample)])
$puts(specs_full.bitrate,[%bitrate%])
$puts(specs_full.channels_num,[$info(channels)])
$puts(specs_full.encoding,[$info(encoding)])

$if($and($get(item.youtube),$stricmp($cut($get(specs_full.codec),3),COM)),
$puts(specs_full.codec,COM)
)

$if($get(specs_full.codec_long_name), $puts(specs_full.codec,$get(specs_full.codec_long_name)) )


$puts(cmt, PROCESS VIDEO CODEC FIRST)

$if($stricmp($substr($get(specs_full.video_codec),6,8),AVC),
$puts(specs_full.video_codec,x264) ,
$if($stricmp($get(specs_full.video_codec),CINEPAK),
$puts(specs_full.video_codec,CINEPK) ,
$if($or($stricmp($cut($get(specs_full.video_codec),5),H.264),$stricmp($substr($get(specs_full.video_codec),2,5),H264),$stricmp($substr($get(specs_full.video_codec),2,6),H.264)),
$puts(specs_full.video_codec,H264) ,
$if($stricmp($cut($get(specs_full.video_codec),5),H.265),
$puts(specs_full.video_codec,H265)
$if($stricmp($cut($get(specs_full.video_codec),5),MPEG1),
$puts(specs_full.video_codec,MPEG1) ,
$if($stricmp($cut($get(specs_full.video_codec),5),MPEG2),
$puts(specs_full.video_codec,MPEG2) ,
$if($stricmp($cut($get(specs_full.video_codec),6),MPEG-4),
$puts(specs_full.video_codec,MPEG4) ,
$if($stricmp($get(specs_full.video_codec),MS/VFW/FOURCC),
$puts(specs_full.video_codec,MSVFW) ,
$if($stricmp($cut($get(specs_full.video_codec),3),VC1),
$puts(specs_full.video_codec,VC1) ,
)))))))))

$puts(cmt, INITIALIZE COMMON CONDENSED SPECS)

$puts(specs_cond.samplerate,$get(specs_full.samplerate))
$puts(specs_cond.bitspersample,$get(specs_full.bitspersample))
$puts(specs_cond.channels_num,$get(specs_full.channels_num))
$puts(specs_cond.bitrate,$get(specs_full.bitrate))


$puts(cmt, CODEC SPECIFIC FULL/CONDENSED SPECS & CLEARING CONDENSED DEFAULTS)

$puts(cmt, Remap MKV --> DTS)
$if($stricmp($get(specs_full.codec),MKV),
$puts(specs_full.codec,DTS)
)

$puts(cmt, AAC default LC 44kHz 2ch)
$if($stricmp($cut($get(specs_full.codec),3),AAC),
$puts(specs_full.codec,AAC)
$ifequal($get(specs_full.codec_profile),LC,
$puts(specs_full.codec_profile,)
,)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, AC3 default 48kHz 640kbps@6ch)
$if($or($stricmp($get(specs_full.codec),AC3),$stricmp($cut($get(specs_full.codec),10),ATSC A/52A)),
$puts(specs_full.codec,AC3)
$ifequal($get(specs_full.samplerate),48, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),6,
$ifequal($get(specs_full.bitrate),640, $puts(specs_cond.bitrate,) ,)
,)
)

$puts(cmt, ADPCM default 44kHz 2ch)
$if($stricmp($cut($get(specs_full.codec),5),ADPCM),
$puts(specs_full.codec,ADPCM)
$puts(specs_full.bitspersample,)
$puts(specs_cond.bitspersample,)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, ALAC default 44kHz 16bit 2ch)
$if($stricmp($cut($get(specs_full.codec),4),ALAC),
$puts(specs_full.codec,ALAC)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.bitspersample),16, $puts(specs_cond.bitspersample,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, CDDA default 44kHz 16bit 2ch)
$if($stricmp($cut($get(specs_full.codec),4),CDDA),
$puts(specs_full.codec,CDDA)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.bitspersample),16, $puts(specs_cond.bitspersample,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, DTS default 48kHz 1509/1510/1536kbps)
$puts(cmt, DTS HD default 48kHz 16bit)
$if($or($stricmp($get(specs_full.codec),DTS),$stricmp($cut($get(specs_full.codec),3),DCA)),
$puts(specs_full.codec,DTS)
$ifequal($get(specs_full.samplerate),48, $puts(specs_cond.samplerate,) ,)
$if($get(specs_full.bitspersample),
$puts(specs_full.codec_profile,HD)
$ifequal($get(specs_full.bitspersample),16, $puts(specs_cond.bitspersample,) ,)
$puts(specs_full.encoding,lossless)
,
$puts(specs_full.encoding,lossy)
$ifequal($get(specs_full.samplerate),96,
,
$ifequal($get(specs_full.bitrate),1509, $puts(specs_cond.bitrate,) ,)
$ifequal($get(specs_full.bitrate),1510, $puts(specs_cond.bitrate,) ,)
$ifequal($get(specs_full.bitrate),1519, $puts(specs_cond.bitrate,) ,)
$ifequal($get(specs_full.bitrate),1536, $puts(specs_cond.bitrate,) ,)
)
)
)

$puts(cmt, EAC default 48kHz)
$if($or($stricmp($get(specs_full.codec),E-AC3),$stricmp($get(specs_full.codec),EAC3),$stricmp($cut($get(specs_full.codec),10),ATSC A/52B)),
$puts(specs_full.codec,EAC)
$ifequal($get(specs_full.samplerate),48, $puts(specs_cond.samplerate,) ,)
)

$puts(cmt, FLAC default 44kHz 16bit 2ch)
$if($stricmp($cut($get(specs_full.codec),4),FLAC),
$puts(specs_full.codec,FLAC)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.bitspersample),16, $puts(specs_cond.bitspersample,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, MAPE default 44kHz 16bit 2ch)
$if($stricmp($cut($get(specs_full.codec),3),Mon),
$puts(specs_full.codec,MAPE)
$puts(specs_full.codec_profile,)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.bitspersample),16, $puts(specs_cond.bitspersample,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, MP2 default 44kHz 2ch)
$if($stricmp($cut($get(specs_full.codec),3),MP2),
$puts(specs_full.codec,MP2)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, MP3 default 44kHz 2ch)
$if($stricmp($cut($get(specs_full.codec),3),MP3),
$puts(specs_full.codec,MP3)
$if($stricmp($cut($get(specs_full.codec_profile),3),VBR),
$puts(specs_full.codec_profile,$substr($get(specs_full.codec_profile),5,256))
$puts(specs_cond.bitrate,)
)
$if($stricmp($cut($get(specs_full.codec_profile),3),CBR),
$puts(specs_full.codec_profile,$get(specs_full.bitrate)$if($stricmp($info(mp3_stereo_mode),stereo),s,$if($stricmp($info(mp3_stereo_mode),joint stereo),js,)))
$puts(specs_cond.bitrate,)
)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, OPUS default 44kHz 2ch)
$if($stricmp($get(specs_full.codec),OPUS),
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, PCM default 44kHz 16bit 2ch)
$if($stricmp($cut($get(specs_full.codec),3),PCM),
$puts(specs_full.codec,PCM)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.bitspersample),16, $puts(specs_cond.bitspersample,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, QDM2 default 44kHz 2ch)
$if($or($stricmp($get(specs_full.codec),QDME2),$stricmp($get(specs_full.codec),QDesign Music Codec 2)),
$puts(specs_full.codec,QDM2)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, TrueHD default 48kHz 24bit)
$if($stricmp($get(specs_full.codec),TRUEHD),
$puts(specs_full.codec,TrueHD)
$ifequal($get(specs_full.samplerate),48, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.bitspersample),24, $puts(specs_cond.bitspersample,) ,)
)

$puts(cmt, Vorbis default 44kHz 2ch)
$if($stricmp($get(specs_full.codec),VORBIS),
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, WMA default 44kHz 2ch)
$if($stricmp($get(specs_full.codec),WMA),
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, WMAV2 default 44kHz 2ch)
$if($stricmp($get(specs_full.codec),WMAV2),
$puts(specs_full.codec,WMA)
$puts(specs_full.codec_profile,V2)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)


$puts(cmt, IN CASE NOT SET - SET ENCODING TO LOSSLESS/LOSSY BASED ON BITSPERSAMPLE)
$if($get(specs_full.encoding),
,
$if($get(specs_full.bitspersample),
$puts(specs_full.encoding,lossless)
,
$puts(specs_full.encoding,lossy)
)
)


$puts(cmt, HDCD PLAYING OR MEDIA TAG HDCD) $puts(cmt, OTHER HDCD vars: %__hdcd_peak_extend% %__hdcd_gain% TF: %__hdcd_transient_filter%)
$if($stricmp($get(specs_full.encoding),lossless),
$if($or($info(hdcd),$stricmp($meta(media),HDCD)),
$puts(overrule,1)
$if(%el_is_group%,
,
$if(%el_isplaying%,
$if($info(hdcd),
$ifequal($get(specs_full.bitspersample),24, $puts(specs_full.bitspersample,20) ,)
,
$puts(overrule,0)
)
)
)
$ifequal($get(overrule),1,
$puts(specs_full.codec,HDCD)
,)
)
)


$puts(cmt, SET FINAL CONDENSED CODEC/CODEC_PROFILE/BITRATE)
$puts(specs_cond.codec,$get(specs_full.codec))
$puts(specs_cond.codec_profile,$get(specs_full.codec_profile))
$if($stricmp($get(specs_full.codec),MP3),
$ifequal(%ROW.SPECS.MP3_CODEC%,        0, $puts(specs_cond.codec,) ,)
$ifequal(%ROW.SPECS.MP3_CODEC_PROFILE%,0, $puts(specs_cond.codec_profile,) ,)
$if($get(item.stream),
,
$ifequal(%ROW.SPECS.MP3_BITRATE%,0, $puts(specs_cond.bitrate,) ,)
)
)
$if($get(specs_cond.codec),
$puts(specs_cond.codec_txt,$get(specs_cond.codec)[-$get(specs_cond.codec_profile)])
,
$puts(specs_cond.codec_txt,[$get(specs_cond.codec_profile)])
)

$puts(cmt, SET FULL/CONDENSED SR_BPS_BR TXT - LOSSY: SAMPLERATE/BITRATE - LOSSLESS: SAMPLERATE/BITSPERSAMPLE)
$if($stricmp($get(specs_full.encoding),lossy),
$puts(specs_full.sr_bps_br,[$get(specs_full.samplerate)kHz])

$if($get(specs_cond.bitrate),
$puts(specs_cond.sr_bps_br,[$get(specs_cond.samplerate)/][$get(specs_cond.bitrate)kbps])
,
$puts(specs_cond.sr_bps_br,[$get(specs_cond.samplerate)kHz])
)
,
$puts(specs_full.sr_bps_br,$get(specs_full.samplerate)/$get(specs_full.bitspersample))
$if($or($get(specs_cond.samplerate),$get(specs_cond.bitspersample)),
$puts(specs_cond.sr_bps_br,$get(specs_full.sr_bps_br))
)
)

$puts(cmt, CLEAR 2ch CONDENSED CHANNELS_TXT IF CHOSEN)
$puts(specs_cond.channels_txt,[$get(specs_cond.channels_num)ch])
$ifequal(%ROW.SPECS.2CH%,0,
$ifequal($get(specs_cond.channels_num),2,
$puts(specs_cond.channels_txt,)
,)
,)

$puts(cmt, CREATE FULL/CONDENSED SPECS STRINGS)
$puts(specs_cond.txt,$replace($substr($ifgreater(%ROW.SPECS.VIDEO%, 0,[|$get(specs_full.video_codec)],)[|$get(specs_cond.codec_txt)][|$get(specs_cond.sr_bps_br)][|$get(specs_cond.channels_txt)],2,512),|,$get(delimiter)))
$puts(specs_full.txt,$replace($substr($ifgreater(%ROW.SPECS.VIDEO%,-1,[|$get(specs_full.video_codec)],)[|$get(specs_full.codec)[-$get(specs_full.codec_profile)]][|$get(specs_full.sr_bps_br)][|%channels%][|$get(specs_full.bitrate)kbps],2,512),|,$get(delimiter)))

I have no idea what should I do with your code:)
What I want to achieve is display the name of DTS format in Column, nothing more. I used the "lossless/lossy" thing but it is not what I want to do.  I just want to be able to extend the DTS with ex. HDMA in a column while playing a track (usually from m2ts file).

Re: DTS/Dolby Codec names in Foobar

Reply #3
Hi,

is it possible to see what exact format of DTS is being played with Foobar?
I have a column named Codec but it only shows DTS no matter what kind of DTS is being played - it would be nice if it showed DTSHDMA or DTS96/24 or others.
When I play Dolby - Foobar shows AC3 or TrueHD (do not know if it also shows others forms as I usually use those two) - would it be possible to display such info regarding DTS forms?
I have already tried $info(codec_profile) but it shows only DTS.


You can make use of $info(bitspersample) to determine if it is lossless or not.
DTS 96/24 not lossless or lossless is a bit of a problem, but I "fix" that by looking to overall bitrate. So anything smaller than 1537kbps bitrate is not lossless. Anything above is.

This bit of code I wrote before all kinds of changes were made in 2.0, 2.1 betas to handling different codec formats, but this code still works. No way to detect DTS:X though which is still identified as DTS-HD MA 7.1.

Have a look at the DTS/DTSHD or AC3/EAC relevant stuff and pick what works for you ...

Code: [Select]
$puts(MOD, --- CODE.SPECS ---)


$puts(cmt, INITIALIZE COMMON FULL SPECS)

$puts(specs_full.video_codec,[$upper($info(video_codec))])
$puts(specs_full.codec_long_name,[$info(codec_long_name)])

$puts(specs_full.codec,[$upper(%codec%)])
$puts(specs_full.codec_profile,[%codec_profile%])
$puts(specs_full.samplerate,[$div(%samplerate%,1000)])
$puts(specs_full.bitspersample,[$info(bitspersample)])
$puts(specs_full.bitrate,[%bitrate%])
$puts(specs_full.channels_num,[$info(channels)])
$puts(specs_full.encoding,[$info(encoding)])

$if($and($get(item.youtube),$stricmp($cut($get(specs_full.codec),3),COM)),
$puts(specs_full.codec,COM)
)

$if($get(specs_full.codec_long_name), $puts(specs_full.codec,$get(specs_full.codec_long_name)) )


$puts(cmt, PROCESS VIDEO CODEC FIRST)

$if($stricmp($substr($get(specs_full.video_codec),6,8),AVC),
$puts(specs_full.video_codec,x264) ,
$if($stricmp($get(specs_full.video_codec),CINEPAK),
$puts(specs_full.video_codec,CINEPK) ,
$if($or($stricmp($cut($get(specs_full.video_codec),5),H.264),$stricmp($substr($get(specs_full.video_codec),2,5),H264),$stricmp($substr($get(specs_full.video_codec),2,6),H.264)),
$puts(specs_full.video_codec,H264) ,
$if($stricmp($cut($get(specs_full.video_codec),5),H.265),
$puts(specs_full.video_codec,H265)
$if($stricmp($cut($get(specs_full.video_codec),5),MPEG1),
$puts(specs_full.video_codec,MPEG1) ,
$if($stricmp($cut($get(specs_full.video_codec),5),MPEG2),
$puts(specs_full.video_codec,MPEG2) ,
$if($stricmp($cut($get(specs_full.video_codec),6),MPEG-4),
$puts(specs_full.video_codec,MPEG4) ,
$if($stricmp($get(specs_full.video_codec),MS/VFW/FOURCC),
$puts(specs_full.video_codec,MSVFW) ,
$if($stricmp($cut($get(specs_full.video_codec),3),VC1),
$puts(specs_full.video_codec,VC1) ,
)))))))))

$puts(cmt, INITIALIZE COMMON CONDENSED SPECS)

$puts(specs_cond.samplerate,$get(specs_full.samplerate))
$puts(specs_cond.bitspersample,$get(specs_full.bitspersample))
$puts(specs_cond.channels_num,$get(specs_full.channels_num))
$puts(specs_cond.bitrate,$get(specs_full.bitrate))


$puts(cmt, CODEC SPECIFIC FULL/CONDENSED SPECS & CLEARING CONDENSED DEFAULTS)

$puts(cmt, Remap MKV --> DTS)
$if($stricmp($get(specs_full.codec),MKV),
$puts(specs_full.codec,DTS)
)

$puts(cmt, AAC default LC 44kHz 2ch)
$if($stricmp($cut($get(specs_full.codec),3),AAC),
$puts(specs_full.codec,AAC)
$ifequal($get(specs_full.codec_profile),LC,
$puts(specs_full.codec_profile,)
,)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, AC3 default 48kHz 640kbps@6ch)
$if($or($stricmp($get(specs_full.codec),AC3),$stricmp($cut($get(specs_full.codec),10),ATSC A/52A)),
$puts(specs_full.codec,AC3)
$ifequal($get(specs_full.samplerate),48, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),6,
$ifequal($get(specs_full.bitrate),640, $puts(specs_cond.bitrate,) ,)
,)
)

$puts(cmt, ADPCM default 44kHz 2ch)
$if($stricmp($cut($get(specs_full.codec),5),ADPCM),
$puts(specs_full.codec,ADPCM)
$puts(specs_full.bitspersample,)
$puts(specs_cond.bitspersample,)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, ALAC default 44kHz 16bit 2ch)
$if($stricmp($cut($get(specs_full.codec),4),ALAC),
$puts(specs_full.codec,ALAC)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.bitspersample),16, $puts(specs_cond.bitspersample,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, CDDA default 44kHz 16bit 2ch)
$if($stricmp($cut($get(specs_full.codec),4),CDDA),
$puts(specs_full.codec,CDDA)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.bitspersample),16, $puts(specs_cond.bitspersample,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, DTS default 48kHz 1509/1510/1536kbps)
$puts(cmt, DTS HD default 48kHz 16bit)
$if($or($stricmp($get(specs_full.codec),DTS),$stricmp($cut($get(specs_full.codec),3),DCA)),
$puts(specs_full.codec,DTS)
$ifequal($get(specs_full.samplerate),48, $puts(specs_cond.samplerate,) ,)
$if($get(specs_full.bitspersample),
$puts(specs_full.codec_profile,HD)
$ifequal($get(specs_full.bitspersample),16, $puts(specs_cond.bitspersample,) ,)
$puts(specs_full.encoding,lossless)
,
$puts(specs_full.encoding,lossy)
$ifequal($get(specs_full.samplerate),96,
,
$ifequal($get(specs_full.bitrate),1509, $puts(specs_cond.bitrate,) ,)
$ifequal($get(specs_full.bitrate),1510, $puts(specs_cond.bitrate,) ,)
$ifequal($get(specs_full.bitrate),1519, $puts(specs_cond.bitrate,) ,)
$ifequal($get(specs_full.bitrate),1536, $puts(specs_cond.bitrate,) ,)
)
)
)

$puts(cmt, EAC default 48kHz)
$if($or($stricmp($get(specs_full.codec),E-AC3),$stricmp($get(specs_full.codec),EAC3),$stricmp($cut($get(specs_full.codec),10),ATSC A/52B)),
$puts(specs_full.codec,EAC)
$ifequal($get(specs_full.samplerate),48, $puts(specs_cond.samplerate,) ,)
)

$puts(cmt, FLAC default 44kHz 16bit 2ch)
$if($stricmp($cut($get(specs_full.codec),4),FLAC),
$puts(specs_full.codec,FLAC)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.bitspersample),16, $puts(specs_cond.bitspersample,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, MAPE default 44kHz 16bit 2ch)
$if($stricmp($cut($get(specs_full.codec),3),Mon),
$puts(specs_full.codec,MAPE)
$puts(specs_full.codec_profile,)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.bitspersample),16, $puts(specs_cond.bitspersample,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, MP2 default 44kHz 2ch)
$if($stricmp($cut($get(specs_full.codec),3),MP2),
$puts(specs_full.codec,MP2)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, MP3 default 44kHz 2ch)
$if($stricmp($cut($get(specs_full.codec),3),MP3),
$puts(specs_full.codec,MP3)
$if($stricmp($cut($get(specs_full.codec_profile),3),VBR),
$puts(specs_full.codec_profile,$substr($get(specs_full.codec_profile),5,256))
$puts(specs_cond.bitrate,)
)
$if($stricmp($cut($get(specs_full.codec_profile),3),CBR),
$puts(specs_full.codec_profile,$get(specs_full.bitrate)$if($stricmp($info(mp3_stereo_mode),stereo),s,$if($stricmp($info(mp3_stereo_mode),joint stereo),js,)))
$puts(specs_cond.bitrate,)
)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, OPUS default 44kHz 2ch)
$if($stricmp($get(specs_full.codec),OPUS),
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, PCM default 44kHz 16bit 2ch)
$if($stricmp($cut($get(specs_full.codec),3),PCM),
$puts(specs_full.codec,PCM)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.bitspersample),16, $puts(specs_cond.bitspersample,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, QDM2 default 44kHz 2ch)
$if($or($stricmp($get(specs_full.codec),QDME2),$stricmp($get(specs_full.codec),QDesign Music Codec 2)),
$puts(specs_full.codec,QDM2)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, TrueHD default 48kHz 24bit)
$if($stricmp($get(specs_full.codec),TRUEHD),
$puts(specs_full.codec,TrueHD)
$ifequal($get(specs_full.samplerate),48, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.bitspersample),24, $puts(specs_cond.bitspersample,) ,)
)

$puts(cmt, Vorbis default 44kHz 2ch)
$if($stricmp($get(specs_full.codec),VORBIS),
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, WMA default 44kHz 2ch)
$if($stricmp($get(specs_full.codec),WMA),
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, WMAV2 default 44kHz 2ch)
$if($stricmp($get(specs_full.codec),WMAV2),
$puts(specs_full.codec,WMA)
$puts(specs_full.codec_profile,V2)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)


$puts(cmt, IN CASE NOT SET - SET ENCODING TO LOSSLESS/LOSSY BASED ON BITSPERSAMPLE)
$if($get(specs_full.encoding),
,
$if($get(specs_full.bitspersample),
$puts(specs_full.encoding,lossless)
,
$puts(specs_full.encoding,lossy)
)
)


$puts(cmt, HDCD PLAYING OR MEDIA TAG HDCD) $puts(cmt, OTHER HDCD vars: %__hdcd_peak_extend% %__hdcd_gain% TF: %__hdcd_transient_filter%)
$if($stricmp($get(specs_full.encoding),lossless),
$if($or($info(hdcd),$stricmp($meta(media),HDCD)),
$puts(overrule,1)
$if(%el_is_group%,
,
$if(%el_isplaying%,
$if($info(hdcd),
$ifequal($get(specs_full.bitspersample),24, $puts(specs_full.bitspersample,20) ,)
,
$puts(overrule,0)
)
)
)
$ifequal($get(overrule),1,
$puts(specs_full.codec,HDCD)
,)
)
)


$puts(cmt, SET FINAL CONDENSED CODEC/CODEC_PROFILE/BITRATE)
$puts(specs_cond.codec,$get(specs_full.codec))
$puts(specs_cond.codec_profile,$get(specs_full.codec_profile))
$if($stricmp($get(specs_full.codec),MP3),
$ifequal(%ROW.SPECS.MP3_CODEC%,        0, $puts(specs_cond.codec,) ,)
$ifequal(%ROW.SPECS.MP3_CODEC_PROFILE%,0, $puts(specs_cond.codec_profile,) ,)
$if($get(item.stream),
,
$ifequal(%ROW.SPECS.MP3_BITRATE%,0, $puts(specs_cond.bitrate,) ,)
)
)
$if($get(specs_cond.codec),
$puts(specs_cond.codec_txt,$get(specs_cond.codec)[-$get(specs_cond.codec_profile)])
,
$puts(specs_cond.codec_txt,[$get(specs_cond.codec_profile)])
)

$puts(cmt, SET FULL/CONDENSED SR_BPS_BR TXT - LOSSY: SAMPLERATE/BITRATE - LOSSLESS: SAMPLERATE/BITSPERSAMPLE)
$if($stricmp($get(specs_full.encoding),lossy),
$puts(specs_full.sr_bps_br,[$get(specs_full.samplerate)kHz])

$if($get(specs_cond.bitrate),
$puts(specs_cond.sr_bps_br,[$get(specs_cond.samplerate)/][$get(specs_cond.bitrate)kbps])
,
$puts(specs_cond.sr_bps_br,[$get(specs_cond.samplerate)kHz])
)
,
$puts(specs_full.sr_bps_br,$get(specs_full.samplerate)/$get(specs_full.bitspersample))
$if($or($get(specs_cond.samplerate),$get(specs_cond.bitspersample)),
$puts(specs_cond.sr_bps_br,$get(specs_full.sr_bps_br))
)
)

$puts(cmt, CLEAR 2ch CONDENSED CHANNELS_TXT IF CHOSEN)
$puts(specs_cond.channels_txt,[$get(specs_cond.channels_num)ch])
$ifequal(%ROW.SPECS.2CH%,0,
$ifequal($get(specs_cond.channels_num),2,
$puts(specs_cond.channels_txt,)
,)
,)

$puts(cmt, CREATE FULL/CONDENSED SPECS STRINGS)
$puts(specs_cond.txt,$replace($substr($ifgreater(%ROW.SPECS.VIDEO%, 0,[|$get(specs_full.video_codec)],)[|$get(specs_cond.codec_txt)][|$get(specs_cond.sr_bps_br)][|$get(specs_cond.channels_txt)],2,512),|,$get(delimiter)))
$puts(specs_full.txt,$replace($substr($ifgreater(%ROW.SPECS.VIDEO%,-1,[|$get(specs_full.video_codec)],)[|$get(specs_full.codec)[-$get(specs_full.codec_profile)]][|$get(specs_full.sr_bps_br)][|%channels%][|$get(specs_full.bitrate)kbps],2,512),|,$get(delimiter)))

I have no idea what should I do with your code:)
What I want to achieve is display the name of DTS format in Column, nothing more. I used the "lossless/lossy" thing but it is not what I want to do.  I just want to be able to extend the DTS with ex. HDMA in a column while playing a track (usually from m2ts file).


EDIT:
Use this one, it also fixes DTS 96/24 or DTS-HD at 96kHz (just tested it):
$if($or($stricmp(%codec%,DTS),$stricmp($cut(%codec%,3),DCA)),$if($info(bitspersample),$ifequal(%samplerate%,96000,$ifgreater(%bitrate%,1537,DTS-HD,DTS 96/$info(bitspersample)),DTS-HD),DTS))

Re: DTS/Dolby Codec names in Foobar

Reply #4
Did some digging:

%codec%[ %codec_profile%]

Would give you DTS HD MA in case of lossless or DTS 96/24 (not lossless) or DTS.
Things really have changed since the 2.0 beta's :-)

Re: DTS/Dolby Codec names in Foobar

Reply #5
Hi,

is it possible to see what exact format of DTS is being played with Foobar?
I have a column named Codec but it only shows DTS no matter what kind of DTS is being played - it would be nice if it showed DTSHDMA or DTS96/24 or others.
When I play Dolby - Foobar shows AC3 or TrueHD (do not know if it also shows others forms as I usually use those two) - would it be possible to display such info regarding DTS forms?
I have already tried $info(codec_profile) but it shows only DTS.


You can make use of $info(bitspersample) to determine if it is lossless or not.
DTS 96/24 not lossless or lossless is a bit of a problem, but I "fix" that by looking to overall bitrate. So anything smaller than 1537kbps bitrate is not lossless. Anything above is.

This bit of code I wrote before all kinds of changes were made in 2.0, 2.1 betas to handling different codec formats, but this code still works. No way to detect DTS:X though which is still identified as DTS-HD MA 7.1.

Have a look at the DTS/DTSHD or AC3/EAC relevant stuff and pick what works for you ...

Code: [Select]
$puts(MOD, --- CODE.SPECS ---)


$puts(cmt, INITIALIZE COMMON FULL SPECS)

$puts(specs_full.video_codec,[$upper($info(video_codec))])
$puts(specs_full.codec_long_name,[$info(codec_long_name)])

$puts(specs_full.codec,[$upper(%codec%)])
$puts(specs_full.codec_profile,[%codec_profile%])
$puts(specs_full.samplerate,[$div(%samplerate%,1000)])
$puts(specs_full.bitspersample,[$info(bitspersample)])
$puts(specs_full.bitrate,[%bitrate%])
$puts(specs_full.channels_num,[$info(channels)])
$puts(specs_full.encoding,[$info(encoding)])

$if($and($get(item.youtube),$stricmp($cut($get(specs_full.codec),3),COM)),
$puts(specs_full.codec,COM)
)

$if($get(specs_full.codec_long_name), $puts(specs_full.codec,$get(specs_full.codec_long_name)) )


$puts(cmt, PROCESS VIDEO CODEC FIRST)

$if($stricmp($substr($get(specs_full.video_codec),6,8),AVC),
$puts(specs_full.video_codec,x264) ,
$if($stricmp($get(specs_full.video_codec),CINEPAK),
$puts(specs_full.video_codec,CINEPK) ,
$if($or($stricmp($cut($get(specs_full.video_codec),5),H.264),$stricmp($substr($get(specs_full.video_codec),2,5),H264),$stricmp($substr($get(specs_full.video_codec),2,6),H.264)),
$puts(specs_full.video_codec,H264) ,
$if($stricmp($cut($get(specs_full.video_codec),5),H.265),
$puts(specs_full.video_codec,H265)
$if($stricmp($cut($get(specs_full.video_codec),5),MPEG1),
$puts(specs_full.video_codec,MPEG1) ,
$if($stricmp($cut($get(specs_full.video_codec),5),MPEG2),
$puts(specs_full.video_codec,MPEG2) ,
$if($stricmp($cut($get(specs_full.video_codec),6),MPEG-4),
$puts(specs_full.video_codec,MPEG4) ,
$if($stricmp($get(specs_full.video_codec),MS/VFW/FOURCC),
$puts(specs_full.video_codec,MSVFW) ,
$if($stricmp($cut($get(specs_full.video_codec),3),VC1),
$puts(specs_full.video_codec,VC1) ,
)))))))))

$puts(cmt, INITIALIZE COMMON CONDENSED SPECS)

$puts(specs_cond.samplerate,$get(specs_full.samplerate))
$puts(specs_cond.bitspersample,$get(specs_full.bitspersample))
$puts(specs_cond.channels_num,$get(specs_full.channels_num))
$puts(specs_cond.bitrate,$get(specs_full.bitrate))


$puts(cmt, CODEC SPECIFIC FULL/CONDENSED SPECS & CLEARING CONDENSED DEFAULTS)

$puts(cmt, Remap MKV --> DTS)
$if($stricmp($get(specs_full.codec),MKV),
$puts(specs_full.codec,DTS)
)

$puts(cmt, AAC default LC 44kHz 2ch)
$if($stricmp($cut($get(specs_full.codec),3),AAC),
$puts(specs_full.codec,AAC)
$ifequal($get(specs_full.codec_profile),LC,
$puts(specs_full.codec_profile,)
,)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, AC3 default 48kHz 640kbps@6ch)
$if($or($stricmp($get(specs_full.codec),AC3),$stricmp($cut($get(specs_full.codec),10),ATSC A/52A)),
$puts(specs_full.codec,AC3)
$ifequal($get(specs_full.samplerate),48, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),6,
$ifequal($get(specs_full.bitrate),640, $puts(specs_cond.bitrate,) ,)
,)
)

$puts(cmt, ADPCM default 44kHz 2ch)
$if($stricmp($cut($get(specs_full.codec),5),ADPCM),
$puts(specs_full.codec,ADPCM)
$puts(specs_full.bitspersample,)
$puts(specs_cond.bitspersample,)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, ALAC default 44kHz 16bit 2ch)
$if($stricmp($cut($get(specs_full.codec),4),ALAC),
$puts(specs_full.codec,ALAC)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.bitspersample),16, $puts(specs_cond.bitspersample,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, CDDA default 44kHz 16bit 2ch)
$if($stricmp($cut($get(specs_full.codec),4),CDDA),
$puts(specs_full.codec,CDDA)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.bitspersample),16, $puts(specs_cond.bitspersample,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, DTS default 48kHz 1509/1510/1536kbps)
$puts(cmt, DTS HD default 48kHz 16bit)
$if($or($stricmp($get(specs_full.codec),DTS),$stricmp($cut($get(specs_full.codec),3),DCA)),
$puts(specs_full.codec,DTS)
$ifequal($get(specs_full.samplerate),48, $puts(specs_cond.samplerate,) ,)
$if($get(specs_full.bitspersample),
$puts(specs_full.codec_profile,HD)
$ifequal($get(specs_full.bitspersample),16, $puts(specs_cond.bitspersample,) ,)
$puts(specs_full.encoding,lossless)
,
$puts(specs_full.encoding,lossy)
$ifequal($get(specs_full.samplerate),96,
,
$ifequal($get(specs_full.bitrate),1509, $puts(specs_cond.bitrate,) ,)
$ifequal($get(specs_full.bitrate),1510, $puts(specs_cond.bitrate,) ,)
$ifequal($get(specs_full.bitrate),1519, $puts(specs_cond.bitrate,) ,)
$ifequal($get(specs_full.bitrate),1536, $puts(specs_cond.bitrate,) ,)
)
)
)

$puts(cmt, EAC default 48kHz)
$if($or($stricmp($get(specs_full.codec),E-AC3),$stricmp($get(specs_full.codec),EAC3),$stricmp($cut($get(specs_full.codec),10),ATSC A/52B)),
$puts(specs_full.codec,EAC)
$ifequal($get(specs_full.samplerate),48, $puts(specs_cond.samplerate,) ,)
)

$puts(cmt, FLAC default 44kHz 16bit 2ch)
$if($stricmp($cut($get(specs_full.codec),4),FLAC),
$puts(specs_full.codec,FLAC)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.bitspersample),16, $puts(specs_cond.bitspersample,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, MAPE default 44kHz 16bit 2ch)
$if($stricmp($cut($get(specs_full.codec),3),Mon),
$puts(specs_full.codec,MAPE)
$puts(specs_full.codec_profile,)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.bitspersample),16, $puts(specs_cond.bitspersample,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, MP2 default 44kHz 2ch)
$if($stricmp($cut($get(specs_full.codec),3),MP2),
$puts(specs_full.codec,MP2)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, MP3 default 44kHz 2ch)
$if($stricmp($cut($get(specs_full.codec),3),MP3),
$puts(specs_full.codec,MP3)
$if($stricmp($cut($get(specs_full.codec_profile),3),VBR),
$puts(specs_full.codec_profile,$substr($get(specs_full.codec_profile),5,256))
$puts(specs_cond.bitrate,)
)
$if($stricmp($cut($get(specs_full.codec_profile),3),CBR),
$puts(specs_full.codec_profile,$get(specs_full.bitrate)$if($stricmp($info(mp3_stereo_mode),stereo),s,$if($stricmp($info(mp3_stereo_mode),joint stereo),js,)))
$puts(specs_cond.bitrate,)
)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, OPUS default 44kHz 2ch)
$if($stricmp($get(specs_full.codec),OPUS),
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, PCM default 44kHz 16bit 2ch)
$if($stricmp($cut($get(specs_full.codec),3),PCM),
$puts(specs_full.codec,PCM)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.bitspersample),16, $puts(specs_cond.bitspersample,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, QDM2 default 44kHz 2ch)
$if($or($stricmp($get(specs_full.codec),QDME2),$stricmp($get(specs_full.codec),QDesign Music Codec 2)),
$puts(specs_full.codec,QDM2)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, TrueHD default 48kHz 24bit)
$if($stricmp($get(specs_full.codec),TRUEHD),
$puts(specs_full.codec,TrueHD)
$ifequal($get(specs_full.samplerate),48, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.bitspersample),24, $puts(specs_cond.bitspersample,) ,)
)

$puts(cmt, Vorbis default 44kHz 2ch)
$if($stricmp($get(specs_full.codec),VORBIS),
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, WMA default 44kHz 2ch)
$if($stricmp($get(specs_full.codec),WMA),
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)

$puts(cmt, WMAV2 default 44kHz 2ch)
$if($stricmp($get(specs_full.codec),WMAV2),
$puts(specs_full.codec,WMA)
$puts(specs_full.codec_profile,V2)
$ifequal($get(specs_full.samplerate),44, $puts(specs_cond.samplerate,) ,)
$ifequal($get(specs_full.channels_num),2, $puts(specs_cond.channels_num,) ,)
)


$puts(cmt, IN CASE NOT SET - SET ENCODING TO LOSSLESS/LOSSY BASED ON BITSPERSAMPLE)
$if($get(specs_full.encoding),
,
$if($get(specs_full.bitspersample),
$puts(specs_full.encoding,lossless)
,
$puts(specs_full.encoding,lossy)
)
)


$puts(cmt, HDCD PLAYING OR MEDIA TAG HDCD) $puts(cmt, OTHER HDCD vars: %__hdcd_peak_extend% %__hdcd_gain% TF: %__hdcd_transient_filter%)
$if($stricmp($get(specs_full.encoding),lossless),
$if($or($info(hdcd),$stricmp($meta(media),HDCD)),
$puts(overrule,1)
$if(%el_is_group%,
,
$if(%el_isplaying%,
$if($info(hdcd),
$ifequal($get(specs_full.bitspersample),24, $puts(specs_full.bitspersample,20) ,)
,
$puts(overrule,0)
)
)
)
$ifequal($get(overrule),1,
$puts(specs_full.codec,HDCD)
,)
)
)


$puts(cmt, SET FINAL CONDENSED CODEC/CODEC_PROFILE/BITRATE)
$puts(specs_cond.codec,$get(specs_full.codec))
$puts(specs_cond.codec_profile,$get(specs_full.codec_profile))
$if($stricmp($get(specs_full.codec),MP3),
$ifequal(%ROW.SPECS.MP3_CODEC%,        0, $puts(specs_cond.codec,) ,)
$ifequal(%ROW.SPECS.MP3_CODEC_PROFILE%,0, $puts(specs_cond.codec_profile,) ,)
$if($get(item.stream),
,
$ifequal(%ROW.SPECS.MP3_BITRATE%,0, $puts(specs_cond.bitrate,) ,)
)
)
$if($get(specs_cond.codec),
$puts(specs_cond.codec_txt,$get(specs_cond.codec)[-$get(specs_cond.codec_profile)])
,
$puts(specs_cond.codec_txt,[$get(specs_cond.codec_profile)])
)

$puts(cmt, SET FULL/CONDENSED SR_BPS_BR TXT - LOSSY: SAMPLERATE/BITRATE - LOSSLESS: SAMPLERATE/BITSPERSAMPLE)
$if($stricmp($get(specs_full.encoding),lossy),
$puts(specs_full.sr_bps_br,[$get(specs_full.samplerate)kHz])

$if($get(specs_cond.bitrate),
$puts(specs_cond.sr_bps_br,[$get(specs_cond.samplerate)/][$get(specs_cond.bitrate)kbps])
,
$puts(specs_cond.sr_bps_br,[$get(specs_cond.samplerate)kHz])
)
,
$puts(specs_full.sr_bps_br,$get(specs_full.samplerate)/$get(specs_full.bitspersample))
$if($or($get(specs_cond.samplerate),$get(specs_cond.bitspersample)),
$puts(specs_cond.sr_bps_br,$get(specs_full.sr_bps_br))
)
)

$puts(cmt, CLEAR 2ch CONDENSED CHANNELS_TXT IF CHOSEN)
$puts(specs_cond.channels_txt,[$get(specs_cond.channels_num)ch])
$ifequal(%ROW.SPECS.2CH%,0,
$ifequal($get(specs_cond.channels_num),2,
$puts(specs_cond.channels_txt,)
,)
,)

$puts(cmt, CREATE FULL/CONDENSED SPECS STRINGS)
$puts(specs_cond.txt,$replace($substr($ifgreater(%ROW.SPECS.VIDEO%, 0,[|$get(specs_full.video_codec)],)[|$get(specs_cond.codec_txt)][|$get(specs_cond.sr_bps_br)][|$get(specs_cond.channels_txt)],2,512),|,$get(delimiter)))
$puts(specs_full.txt,$replace($substr($ifgreater(%ROW.SPECS.VIDEO%,-1,[|$get(specs_full.video_codec)],)[|$get(specs_full.codec)[-$get(specs_full.codec_profile)]][|$get(specs_full.sr_bps_br)][|%channels%][|$get(specs_full.bitrate)kbps],2,512),|,$get(delimiter)))

I have no idea what should I do with your code:)
What I want to achieve is display the name of DTS format in Column, nothing more. I used the "lossless/lossy" thing but it is not what I want to do.  I just want to be able to extend the DTS with ex. HDMA in a column while playing a track (usually from m2ts file).


EDIT:
Use this one, it also fixes DTS 96/24 or DTS-HD at 96kHz (just tested it):
$if($or($stricmp(%codec%,DTS),$stricmp($cut(%codec%,3),DCA)),$if($info(bitspersample),$ifequal(%samplerate%,96000,$ifgreater(%bitrate%,1537,DTS-HD,DTS 96/$info(bitspersample)),DTS-HD),DTS))

Thank you, it works but this one is not for me. I need something that displays all kinds of codecs in one and the same columns - mp3, flac, pcm, bluray_pcm, ac3, truehd, dts.....and I lack dtshdma....

Re: DTS/Dolby Codec names in Foobar

Reply #6
Did some digging:

%codec%[ %codec_profile%]

Would give you DTS HD MA in case of lossless or DTS 96/24 (not lossless) or DTS.
Things really have changed since the 2.0 beta's :-)

Unfortunatell it does nothing in my case. It displays exactly the same things as %codec%. It displays only DTS no matter what kind of DST is being played.

Re: DTS/Dolby Codec names in Foobar

Reply #7
What version of foobar are you running?

I tested on 2.1.1 x86 and both methods work fine.

Re: DTS/Dolby Codec names in Foobar

Reply #8
What version of foobar are you running?

I tested on 2.1.1 x86 and both methods work fine.
I installed 2.1.2/64 today. Till yesterday I used 2.1.1/64.
I play DTSHDMA from m2ts files (bluray) - maybe it does not work with them? I do not use MKV or any other rips/demuxes. Only bluray files without any conversion.
The long version (from your earlier post) works with DTS but it does not display anything if the file is not DTS (blank columns).
The second one (%codec%[ %codec_profile%]) displays exactly the same things as %codec%.
%codec_profile% also displays the same thing so no matter if I use codec or codecprofile or codec-codecprofile it stays the same.


Re: DTS/Dolby Codec names in Foobar

Reply #9
Just tested. As if foobar does not support the m2ts.

You have to install FFmpeg Decoder Wrapper 0.8.fb2k-component, point it to where you have ffmpeg.exe and ffprobe.exe
and then in settings you have to make an  entry for *.ts;*.m2ts. And then you can play DTS-HD from ts and m2ts files and even enjoy the video if you install foo_youtube.

See attachment

Re: DTS/Dolby Codec names in Foobar

Reply #10
Just tested. As if foobar does not support the m2ts.

You have to install FFmpeg Decoder Wrapper 0.8.fb2k-component, point it to where you have ffmpeg.exe and ffprobe.exe
and then in settings you have to make an  entry for *.ts;*.m2ts. And then you can play DTS-HD from ts and m2ts files and even enjoy the video if you install foo_youtube.

See attachment

Yes, that is the way I play bluray with foobar....but it shows only DTS in the Column corresponding with Codec. The same m2ts file shows AC3 or TrueHD when I switch streams. So....still no method of properly distinguishing versions of DTS?

Re: DTS/Dolby Codec names in Foobar

Reply #11
Just tested. As if foobar does not support the m2ts.

You have to install FFmpeg Decoder Wrapper 0.8.fb2k-component, point it to where you have ffmpeg.exe and ffprobe.exe
and then in settings you have to make an  entry for *.ts;*.m2ts. And then you can play DTS-HD from ts and m2ts files and even enjoy the video if you install foo_youtube.

See attachment

Yes, that is the way I play bluray with foobar....but it shows only DTS in the Column corresponding with Codec. The same m2ts file shows AC3 or TrueHD when I switch streams. So....still no method of properly distinguishing versions of DTS?
Just tested. As if foobar does not support the m2ts.

You have to install FFmpeg Decoder Wrapper 0.8.fb2k-component, point it to where you have ffmpeg.exe and ffprobe.exe
and then in settings you have to make an  entry for *.ts;*.m2ts. And then you can play DTS-HD from ts and m2ts files and even enjoy the video if you install foo_youtube.

See attachment

Yes, that is the way I play bluray with foobar....but it shows only DTS in the Column corresponding with Codec. The same m2ts file shows AC3 or TrueHD when I switch streams. So....still no method of properly distinguishing versions of DTS?

Tested some more.
Probably you did not use my oneliner but %codec%[ %codec_profile%].
If you play DTS-HD that's embedded inside a m2ts file %codec_profile% will be empty so %codec%[ %codec_profile%] only gives DTS back.

Therefore I stick to this
Code: [Select]
$if($or($stricmp(%codec%,DTS),$stricmp($cut(%codec%,3),DCA)),$if($info(bitspersample),$ifequal(%samplerate%,96000,$ifgreater(%bitrate%,1537,DTS-HD,DTS 96/$info(bitspersample)),DTS-HD),DTS))
which does show DTS-HD.

My code decides upon the fact that $info(bitspersample) has a value which only DTS-HD (and DTS 96/24) have.

You can also see that for a m2ts the bitrate reported is the overall bitrate and not the bitrate of the selected stream.
So there is something dodgy about m2ts support.

Included some screenshots of the m2ts I'm testing with , and the mkv I made of it. In the playing list the value between xx is %codec[ %codec_profile%] and between yy my oneliner. The last column is the full code I send you earlier. Note that in case of to mkv all methods work. On the left part of the screens you can see the different tags foobar has available for the particular file.

Hope this helps.

Re: DTS/Dolby Codec names in Foobar

Reply #12
Just tested. As if foobar does not support the m2ts.

You have to install FFmpeg Decoder Wrapper 0.8.fb2k-component, point it to where you have ffmpeg.exe and ffprobe.exe
and then in settings you have to make an  entry for *.ts;*.m2ts. And then you can play DTS-HD from ts and m2ts files and even enjoy the video if you install foo_youtube.

See attachment

Yes, that is the way I play bluray with foobar....but it shows only DTS in the Column corresponding with Codec. The same m2ts file shows AC3 or TrueHD when I switch streams. So....still no method of properly distinguishing versions of DTS?
Just tested. As if foobar does not support the m2ts.

You have to install FFmpeg Decoder Wrapper 0.8.fb2k-component, point it to where you have ffmpeg.exe and ffprobe.exe
and then in settings you have to make an  entry for *.ts;*.m2ts. And then you can play DTS-HD from ts and m2ts files and even enjoy the video if you install foo_youtube.

See attachment

Yes, that is the way I play bluray with foobar....but it shows only DTS in the Column corresponding with Codec. The same m2ts file shows AC3 or TrueHD when I switch streams. So....still no method of properly distinguishing versions of DTS?

Tested some more.
Probably you did not use my oneliner but %codec%[ %codec_profile%].
If you play DTS-HD that's embedded inside a m2ts file %codec_profile% will be empty so %codec%[ %codec_profile%] only gives DTS back.

Therefore I stick to this
Code: [Select]
$if($or($stricmp(%codec%,DTS),$stricmp($cut(%codec%,3),DCA)),$if($info(bitspersample),$ifequal(%samplerate%,96000,$ifgreater(%bitrate%,1537,DTS-HD,DTS 96/$info(bitspersample)),DTS-HD),DTS))
which does show DTS-HD.

My code decides upon the fact that $info(bitspersample) has a value which only DTS-HD (and DTS 96/24) have.

You can also see that for a m2ts the bitrate reported is the overall bitrate and not the bitrate of the selected stream.
So there is something dodgy about m2ts support.

Included some screenshots of the m2ts I'm testing with , and the mkv I made of it. In the playing list the value between xx is %codec[ %codec_profile%] and between yy my oneliner. The last column is the full code I send you earlier. Note that in case of to mkv all methods work. On the left part of the screens you can see the different tags foobar has available for the particular file.

Hope this helps.

Thank you for your help, but your oneliner only works with DTS. When playing other files (ex. mp3, flac, wav, m2ts with ac3 or TrueHD) it stays blank.
And your oneliner and probably also the full-code are guessing from the bitrate? I thought such things are given and it was just a matter or presenting them in the column.


Re: DTS/Dolby Codec names in Foobar

Reply #13
Thank you for your help, but your oneliner only works with DTS. When playing other files (ex. mp3, flac, wav, m2ts with ac3 or TrueHD) it stays blank.
And your oneliner and probably also the full-code are guessing from the bitrate? I thought such things are given and it was just a matter or presenting them in the column.

What do you mean? You asked how to fix DTS-HD not showing up in m2ts and I gave a bit of code for that.
Just put %codec%[ %codec_profile%] in the else part of the if of the oneliner and you get all other codec info for things like AC3, flac and mp3.

This specific bit with the "guessing" I had to write because of the exact issues you are encountering with DTS (and E-AC and TrueHD).
Things are a lot better now since the final releases of foobar but apparently embedded DTS-HD in a m2ts is still not detected.

This line reverts automatically to %codec%[ %codec_profile%] if %codec% is not DTS. If you get too much info just remove the [ %codec_profile%] part.
Code: [Select]
$if($or($stricmp(%codec%,DTS),$stricmp($cut(%codec%,3),DCA)),$if($info(bitspersample),$ifequal(%samplerate%,96000,$ifgreater(%bitrate%,1537,DTS-HD,DTS 96/$info(bitspersample)),DTS-HD),DTS),%codec% [%codec_profile%])

Re: DTS/Dolby Codec names in Foobar

Reply #14
Didn't you say you need to use FFmpeg Input Wrapper to support these formats? If so, all the codec info you see is reported by FFmpeg.
If these are videos, wouldn't a video player be better suited for playing them? And if they are audio, wouldn't it be better to extract just the audio part to some sane container? Then you could add nice tags and complain if foobar2000 didn't report codec info correctly.

Re: DTS/Dolby Codec names in Foobar

Reply #15
Thank you for your help, but your oneliner only works with DTS. When playing other files (ex. mp3, flac, wav, m2ts with ac3 or TrueHD) it stays blank.
And your oneliner and probably also the full-code are guessing from the bitrate? I thought such things are given and it was just a matter or presenting them in the column.

What do you mean? You asked how to fix DTS-HD not showing up in m2ts and I gave a bit of code for that.
Just put %codec%[ %codec_profile%] in the else part of the if of the oneliner and you get all other codec info for things like AC3, flac and mp3.

This specific bit with the "guessing" I had to write because of the exact issues you are encountering with DTS (and E-AC and TrueHD).
Things are a lot better now since the final releases of foobar but apparently embedded DTS-HD in a m2ts is still not detected.

This line reverts automatically to %codec%[ %codec_profile%] if %codec% is not DTS. If you get too much info just remove the [ %codec_profile%] part.
Code: [Select]
$if($or($stricmp(%codec%,DTS),$stricmp($cut(%codec%,3),DCA)),$if($info(bitspersample),$ifequal(%samplerate%,96000,$ifgreater(%bitrate%,1537,DTS-HD,DTS 96/$info(bitspersample)),DTS-HD),DTS),%codec% [%codec_profile%])

Once again thank you for your help. The last code resolved my problem (besides "guesing method of DTSHD detection"). I did not know how to connect part of your code to make them work for all signals.
As for TrueHD and E-AC: I do not have problems with TrueHD - it always shows TrueHD and I do not have any E-AC files so do not know if it works. Do you know of any problems with proper TrueHD Codec diplay in Columns?
Once again thank you.
It would be nice if Foobar devs implemented "real" DTS-HD detection embedded in m2ts file in the program or by some component.

Re: DTS/Dolby Codec names in Foobar

Reply #16
Didn't you say you need to use FFmpeg Input Wrapper to support these formats? If so, all the codec info you see is reported by FFmpeg.
If these are videos, wouldn't a video player be better suited for playing them? And if they are audio, wouldn't it be better to extract just the audio part to some sane container? Then you could add nice tags and complain if foobar2000 didn't report codec info correctly.
1. Yes I use Wrapper.
2. Yes Wrpapper shows codecs but unfortunatelly when I play DTS-HDMA from m2ts files it shows DTS - it does not see the difference between different DTS formats.
2.a What does show codec from FFPEG do in the Wrapper? Nothing changes when I tick it on or off - the Column displays the same names.
3. I play audio from bluray (music records sold on bluray disks). They contain video or at least stills because it is probably obligatory with bluray but music is the important part for me. I sometimes watch those videos or stills with mpv plugin for foobar. What would be best for me is to have one universal palyer for everything....and Foobar is closest to it (with lots of plugins). What keeps me away from other players is ex. lack of ASIO as I use it every day.
4. It wouldnt be better to extract audio beacuse I want to have original files with all the options, formats bells and whistles...plus do not want to waste time and HDD space to convert/change and so on..
5. Tags would be great but not touching/changing the files is more important to me.
Thank you for your interest and help.
My original problem seemed easy to me but it turned out to be quite insolvable at the moment. For now I started to use Defenders "quesing" method but would be very happy to see "real" DTSHD detection in Foobar or Wrapper or any other possibility.

 

Re: DTS/Dolby Codec names in Foobar

Reply #17
1. Yes I use Wrapper.
2. Yes Wrpapper shows codecs but unfortunatelly when I play DTS-HDMA from m2ts files it shows DTS - it does not see the difference between different DTS formats.
I acquired a sample DTS-HD MA file in m2ts container. Turns out FFmpeg can tell its codec info, foobar2000 just doesn't utilize that part of the output.

2.a What does show codec from FFPEG do in the Wrapper? Nothing changes when I tick it on or off - the Column displays the same names.
foobar2000 caches metadata for files, it always has done that. If file doesn't change it will show the cached info. When changing decoders or decoder settings, you'll need to reload info from the affected files.
The option will define whether %codec% returns the name you have given for the format or the codec info FFmpeg returns for the track.