mirror of
https://github.com/encounter/rust-ffmpeg-zmwangx.git
synced 2026-07-10 21:18:40 -07:00
fix(examples): adjust transcode-x264 for Dictionary changes (9440621ff8)
This commit is contained in:
@@ -127,12 +127,14 @@ impl Transcoder {
|
||||
}
|
||||
}
|
||||
|
||||
fn parse_opts<'a>(s: String) -> Option<Dictionary<'a>> {
|
||||
fn parse_opts<'a>(s: String) -> Option<Dictionary> {
|
||||
let mut dict = Dictionary::new();
|
||||
for keyval in s.split_terminator(',') {
|
||||
let tokens: Vec<&str> = keyval.split('=').collect();
|
||||
match tokens[..] {
|
||||
[key, val] => dict.set(key, val),
|
||||
[key, val] => {
|
||||
dict.set(key, val);
|
||||
}
|
||||
_ => return None,
|
||||
}
|
||||
}
|
||||
@@ -145,7 +147,7 @@ fn main() {
|
||||
let x264_opts = parse_opts(env::args().nth(3).unwrap_or_else(|| DEFAULT_X264_OPTS.to_string()))
|
||||
.expect("invalid x264 options string");
|
||||
|
||||
eprintln!("x264 options: {:?}", x264_opts);
|
||||
eprintln!("x264 options: {:?}", &x264_opts);
|
||||
|
||||
ffmpeg::init().unwrap();
|
||||
|
||||
@@ -176,7 +178,7 @@ fn main() {
|
||||
&ist,
|
||||
&mut octx,
|
||||
ost_index as _,
|
||||
x264_opts.to_owned(),
|
||||
x264_opts.clone(),
|
||||
Some(ist_index) == best_video_stream_index,
|
||||
)
|
||||
.unwrap(),
|
||||
|
||||
Reference in New Issue
Block a user