auto-subtitle
auto-subtitle copied to clipboard
Enable saving subtitles as .txt file
TLDR
This PR introduces an option (--output_txt) to save subtitles directly into text files, facilitating research and other text-based analyses. This feature caters to users who prefer working with plain text for easier manipulation and integration with various tools.
Key Changes
-
Added --output_txt CLI argument.
-
Implemented text file saving in the get_subtitles function.
Motivation
Providing subtitles in txt format supports diverse applications, including NLP research, educational content creation, and media processing. It simplifies workflows by offering a straightforward, editable format.
Usage
Enable text file output with --output_txt true when running auto_subtitle.
Testing
The feature has been tested across multiple video inputs to ensure reliable text output alongside existing .srt file generation.
This streamlined functionality aims to enhance the tool's versatility for all users.
PR Summary
-
Introduction of New Command Line Argument A new command line argument named
--output_txt
has been added. This allows users to choose whether or not they want to save the subtitles in a text file. It offers greater flexibility to control the flow of the script. -
Function 'get_subtitles' Modification The
get_subtitles
function has been updated to work in conjunction with the newoutput_txt
argument. It now has the ability to save subtitles to a text file whenoutput_txt
is enabled (True). This makes the subtitle extraction process more adaptable to users' specific needs.