pub struct Cli {
pub input: PathBuf,
pub output: Option<PathBuf>,
pub model: PathBuf,
pub language: Option<String>,
pub translate: bool,
pub srt_only: bool,
pub keep_temp: bool,
pub ffmpeg: Option<PathBuf>,
}Expand description
命令行配置,由 clap::Parser 从进程参数解析。
§示例
video-subtitle -i demo.mp4 -m ggml-base.bin -l zh
video-subtitle -i demo.mp4 -m ggml-small.bin --srt-only --keep-tempFields§
§input: PathBuf输入视频文件路径。
output: Option<PathBuf>烧录字幕后的输出视频路径。
未指定时默认为输入文件同目录下的 {原名}_subtitled.mp4。
model: PathBufWhisper GGML 模型文件路径(如 ggml-base.bin)。
language: Option<String>识别语言 ISO 代码,例如 zh、en。
传 auto 或省略则由 Whisper 自动检测。
translate: bool启用 Whisper 翻译模式:将非英语内容译为英语。
srt_only: bool仅生成 SRT,不执行第四步字幕烧录。
keep_temp: bool流程结束后保留临时 .tmp.wav / .tmp.srt 文件。
ffmpeg: Option<PathBuf>ffmpeg 可执行文件路径;省略则在 PATH 中查找 ffmpeg / ffmpeg.exe。
Trait Implementations§
Source§impl Args for Cli
impl Args for Cli
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Append to
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl CommandFactory for Cli
impl CommandFactory for Cli
Source§impl FromArgMatches for Cli
impl FromArgMatches for Cli
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Source§impl Parser for Cli
impl Parser for Cli
Source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Parse from iterator, exit on error.
Source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Parse from iterator, return Err on error.
Source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Auto Trait Implementations§
impl Freeze for Cli
impl RefUnwindSafe for Cli
impl Send for Cli
impl Sync for Cli
impl Unpin for Cli
impl UnsafeUnpin for Cli
impl UnwindSafe for Cli
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more