PlanetRead / PR-Repository

5 stars 9 forks source link

SLS Model Code From Scratch #13

Open anushkasaxena07 opened 3 months ago

anushkasaxena07 commented 3 months ago

2 [DMP 2024]: Auto Subtitler for Indian Languages #2

Please find below a description of a Python script that can generate SRT (SubRip) files for videos in Tamil, Telugu, and Kannada languages. The script takes a video file and a corresponding text file as input and generates SRT files with subtitles for the given video content. Here is a step-by-step guide on how the script works and what you need to run it:

  1. Purpose: The script is designed to generate SRT files with subtitles for Tamil, Telugu, and Kannada videos. The output file will have the same name as the input video file, with the language appended at the end (for example, example_video_Tamil.srt).

  2. How it Works:

    • The script first loads the video content and the text content from the provided files.
    • Depending on the language chosen (Tamil, Telugu, or Kannada), it aligns and segments the text to synchronize with the video content.
    • The alignment and segmentation are language-specific, with separate methods for Tamil, Telugu, and Kannada.
    • Finally, it creates SRT files with the generated subtitles.
  3. What's Needed:

    • Video File: You need a video file in a format that can be processed. Make sure to provide the correct path to the video file (for example, example_video.mp4 in this script).
    • Text File: You need a text file containing the transcript or dialogue of the video. This text should correspond to the language of the video. Provide the path to this file (for example, example_text.txt in this script).
    • Dependencies: The script relies on Python's standard library and does not require any additional dependencies.
  4. Running the Script:

    • Save the script into a Python file (for example, subtitle_generator.py).
    • Place your video file and text file in the same directory as the script.
    • Run the script in a Python environment.
    • It will generate SRT files for each language specified (Tamil, Telugu, and Kannada), each named after the video file with the language appended (for example, example_video_Tamil.srt).
    • Check the console output for confirmation of successful SRT generation.

Please note that the placeholder methods (load_video, align_and_segment_tamil, align_and_segment_telugu, align_and_segment_kannada) in the script need to be replaced with actual implementations tailored to your requirements, especially for loading the video and aligning/segmenting the text based on the language.

anushkasaxena07 commented 3 months ago

10 done

anushkasaxena07 commented 3 months ago

11 done

anushkasaxena07 commented 3 months ago

issue #13 #2 #11 #10 #12 done