Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Subtitles

Reply
 
Thread Tools Search this Thread Display Modes
Old 5th December 2022, 20:32   #1  |  Link
Tschizzey
Registered User
 
Join Date: Nov 2022
Posts: 14
Muxing fonts only present in .ass file

Hi all,

I have some .ass subtitles, each using different fonts.
I want to mux each subtitle and the matching fonts into different video files (mkv container).
I want to do this without adding all the fonts into the container, instead adding only those that are actually listed in the .ass file.
Since there are a lot of subtitles and I don't want to open them one by one and pick the fonts that are alike, I'm searching for a different method.
For example if there was a method where the same fonts could be copied into separate folders using a script or batch file, that would be the best.
I have no coding experience sadly. Also I'm on Win 10.

Can you help me?

Last edited by Tschizzey; 5th December 2022 at 21:37.
Tschizzey is offline   Reply With Quote
Old 22nd January 2023, 20:47   #2  |  Link
Tschizzey
Registered User
 
Join Date: Nov 2022
Posts: 14
If anyone reads this in the future, I managed to solve my problem with a Linux command a friend gave me.

Code:
for x in *ass; do cat "$x" | grep 'Style:' | awk -F, '{ print $2 }' | sed '/^$/d' | sort -u > "$x".txt; done
I'm using a Ubuntu VM.
Tschizzey is offline   Reply With Quote
Old 2nd February 2023, 13:17   #3  |  Link
Ninelpienel
Registered User
 
Join Date: Jul 2015
Posts: 4
There is an easier way:

https://github.com/moi15moi/FontCollector

Code:
fontCollector -i "subtitle_episode_01.ass" -o "C:\fonts_for_episode_01" --additional-fonts "C:\all_fonts"
You can loop through the folder with commands like this (batch file):

Code:
SET attachments=
FOR /F "delims=" %%f IN ('DIR /B /S "fonts_for_episode_01\*.ttf"') DO (
	SET attachments=%attachments% --attach-file "%%f"
	)
FOR /F "delims=" %%f IN ('DIR /B /S "fonts_for_episode_01\*.otf"') DO (
	SET attachments=%attachments% --attach-file "%%f"
	)
and using the variable %attachments% in your muxing script.

Last edited by Ninelpienel; 2nd February 2023 at 13:25.
Ninelpienel is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:30.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.