Skip to content

jianliao/transsubs-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TransSubs-AI

Introduction

Welcome to TransSubs-AI, a powerful and intuitive tool designed to transform the way we work with video subtitles. This repository holds a Python application capable of extracting audio from video files, transcribing it, translating the subtitles into various languages, and generating a title and description for the video in the translated language. It's a perfect blend of technology and convenience for content creators, translators, and anyone working with multilingual video content. AI Assistant Workflow

Technologies

TransSubs-AI leverages several cutting-edge technologies and tools:

  • Whisper.cpp: An efficient tool for audio transcription, which can be found at Whisper.cpp GitHub Repository.
  • ffmpeg: A complete, cross-platform solution to record, convert and stream audio and video. More details can be found at ffmpeg Official Website.
  • OpenAI Whisper Model: Utilized for accurate transcription of audio into text.
  • OpenAI ChatGPT Completion API: Powers the translation of subtitles and the generation of video titles and descriptions.

Usage

To use TransSubs-AI, follow these steps:

  1. Environment Setup:
    • Create a Conda virtual environment using Python 3.10 for consistent performance.
    • Install necessary libraries by running:
      pip install -r requirements.txt
      
    • Rename example.env to .env and fill in the missing information
    • pip install .
  2. Running the Application:
    • Use the command line interface (CLI) to easily process your videos. Here's an example command to get you started:
      > video_subs -h
       usage: video_subs [-h] [--output_path OUTPUT_PATH] [--blur_area {kron4,abc7}] [--trim_end {abc7,inside,nbc}] [--cn_only CN_ONLY] [--llm {ollama,openai,claude}] video_url
       
       Process a video file to generate translated subtitles.
       
       positional arguments:
         video_url             The path to the input video file.
       
       options:
         -h, --help            show this help message and exit
         --output_path OUTPUT_PATH
                               The path to the output video files.
         --blur_area {kron4,abc7}
                               Specify the key for a preset blur area. If not provided, no blur area is applied.
         --trim_end {abc7,inside,nbc}
                               Specify the key for a preset trim end. If not provided, no trim end is applied.
         --cn_only CN_ONLY     Chinese subtitle only.
         --llm {ollama,openai,claude}
                               Specify the language model to use. Default is ollama.
      

We hope TransSubs-AI makes your work with subtitles more efficient and enjoyable. Feel free to contribute to this project by submitting pull requests or reporting issues.

Happy subtitling!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published