Display/Remove Close Captions

Support for Windows users
Post Reply
DigidocTN
Posts: 15
Joined: 10 Jul 2025, 12:45
Location: N Georgia, near Chattanooga

Display/Remove Close Captions

Post by DigidocTN »

I use Filebot to rename my TV and Music collections. For TV, I use:

Format: Select all

{n.upperInitial()} ({y}) 
{s.pad(2)}x{e.pad(2)} {t.upperInitial()} 

{ if (vcf != /HEVC/) ' [NOT HEVC]' }
{
	if (width >= 3840 || height >= 2160) return " [4K]"
	if (width >= 1280 || height >= 720) return " [HD]"
	return " [SD]"
}
This does capitalization, determines the internal encoding, and adds the resolution to the end as either 4K; HD; or SD.

Is is possible, to examine the files for CAPTIONS and add a tag so I know which files I need to remove them from? I detest captions and want to remove them from my Jellyfin playback without needing to remove them file by file. One day, I want to learn how to post-process a remux to remove them permanently. For now, I am content to merely identify the files.
DigidocTN
Posts: 15
Joined: 10 Jul 2025, 12:45
Location: N Georgia, near Chattanooga

Re: Display/Remove Close Captions

Post by DigidocTN »

Using my naming, I get the following output:

Format: Select all

Better Call Saul (2015) 01x01 Uno [HD].mkv
Better Call Saul (2015) 01x02 Mijo [HD].mkv
Better Call Saul (2015) 01x03 Nacho [HD].mkv
Better Call Saul (2015) 01x04 Hero [HD].mkv
Better Call Saul (2015) 01x05 Alpine Shepherd Boy [HD].mkv
Better Call Saul (2015) 01x06 Five-O [HD].mkv
Better Call Saul (2015) 01x07 Bingo [HD].mkv
Better Call Saul (2015) 01x08 RICO [HD].mkv
Better Call Saul (2015) 01x09 Pimento [HD].mkv
Better Call Saul (2015) 01x10 Marco [HD].mkv
This what I want, except to add [CC2] to indicate there are 2 close caption tracks inside the file.
User avatar
rednoah
The Source
Posts: 24583
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Display/Remove Close Captions

Post by rednoah »

:?: Can you share the MediaInfo table for one of these files you want to tag with CC2?


:idea: In general, you can do something like this to check the number of subtitle tracks and then add a CC2 / CC3 / CC4 / etc marker accordingly:

Format: Select all

{
	def cc = text.size()
	if (cc >= 2) return " [CC$cc]"
}
:idea: Please read the FAQ and How to Request Help.
DigidocTN
Posts: 15
Joined: 10 Jul 2025, 12:45
Location: N Georgia, near Chattanooga

Re: Display/Remove Close Captions

Post by DigidocTN »

Forgive me, I have mild dementia. I found the mediainfo table, but I see no way to capture it for here. I do see the field I want is [textLanguages] and the file sample has [zh, en] as the value. (zh=Chinese, en=English). Another sample where I have stripped the CC, has nothing in this field.

IF [textLanguages] is not equal to [null] then display {HasCC} at the end of my file name? Thanks.
User avatar
rednoah
The Source
Posts: 24583
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Display/Remove Close Captions

Post by rednoah »

:idea: You can click on the Copy to Clipboard button and then paste the content via CTRL+V here in the forums.

Icon Open FileBot ➔ Icon Edit Format ➔ Icon Change Sample ➔ Icon Select Media File ➔ Icon Open MediaInfoCopy to Clipboard

Screenshot



:?: Does this code work for your files? If this code doesn't do exactly what you want already, how is what you want different?

e.g. check number of subtitle streams:

Format: Select all

{
	def cc = text.size()
	if (cc >= 2) return " [CC$cc]"
}
e.g. just check if textLanguages is defined at all:

Format: Select all

{
	if (textLanguages) " {HasCC}"
}
:idea: Please read the FAQ and How to Request Help.
Post Reply