• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support Troubleshooting Subtitles Problem

     
    • 0 Vote(s) - 0 Average

    Subtitles Problem

    Subtitles Problem
    biolan
    Offline

    Junior Member

    Posts: 1
    Threads: 0
    Joined: 2025 Jan
    Reputation: 0
    #7
    2025-01-02, 04:25 AM
    (2023-07-02, 09:06 PM)skribe Wrote: I'm afraid that I have very little personal experience with subtitles. I would imagine that there isn't a way to add fonts to a TV app client. You may need, instead, to install them on the server device and force subtitle burn-in. The burn-in setting is a user setting in the client I believe, and the relevant server setting is the "fallback fonts" section under the playback section of your dashboard.

    Just make sure to install a font that has complete support for all of the special characters utilized by whatever language you're trying to play.

    Hi,

    I've used the python script made by Yababakets with success and thank you for the explanation.

    Here i modified the code to be able to specify the directory as an argument.

    Code:
    import os
    import codecs
    import argparse


    def is_utf8(file_path):
        try:
            with open(file_path, 'r', encoding='UTF-8') as f:
                f.read()
            return True
        except UnicodeDecodeError:
            return False


    def convert_encoding(file_path):
        with codecs.open(file_path, 'r', 'ISO-8859-2') as f:
            content = f.read()
        with codecs.open(file_path, 'w', 'UTF-8') as f:
            f.write(content)


    def process_directory(directory):
        for root, _, files in os.walk(directory):
            for file in files:
                if file.endswith(('.sub', '.srt')):
                    file_path = os.path.join(root, file)
                    if not is_utf8(file_path):
                        convert_encoding(file_path)
                        print(f"Converted: {file_path}")
                    else:
                        print(f"Skipping: {file_path} (already UTF-8)")


    if __name__ == "__main__":
        parser = argparse.ArgumentParser(description="Convert subtitle files (.sub, .srt) to UTF-8.")
        parser.add_argument("directory", type=str, help="Path to the directory containing subtitle files.")
        args = parser.parse_args()

        if os.path.isdir(args.directory):
            process_directory(args.directory)
        else:
            print(f"Error: {args.directory} is not a valid directory.")

    Usage 
    Code:
    python iso2utf.py /media/movies/final
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    Messages In This Thread
    Subtitles Problem - by adymaster - 2023-06-30, 04:26 PM
    RE: Subtitles Problem - by skribe - 2023-06-30, 09:23 PM
    RE: Subtitles Problem - by adymaster - 2023-07-01, 11:31 AM
    RE: Subtitles Problem - by skribe - 2023-07-02, 09:06 PM
    RE: Subtitles Problem - by Yababakets - 2024-08-17, 08:11 AM
    RE: Subtitles Problem - by Nemessis - 2024-12-27, 05:34 PM
    RE: Subtitles Problem - by biolan - 2025-01-02, 04:25 AM

    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode