render videos with 3x bitrate
This commit is contained in:
parent
f2f3f67d10
commit
27c7cb3c7d
3 changed files with 18 additions and 9 deletions
|
@ -110,7 +110,7 @@ enum FfmpegFilter {
|
|||
pub(crate) struct Ffmpeg {
|
||||
inputs: Vec<FfmpegInput>,
|
||||
filter: FfmpegFilter,
|
||||
video_bitrate: Option<&'static str>,
|
||||
video_bitrate: Option<u64>,
|
||||
output: FfmpegOutput,
|
||||
|
||||
filter_idx: usize
|
||||
|
@ -182,7 +182,7 @@ impl Ffmpeg {
|
|||
self
|
||||
}
|
||||
|
||||
pub fn set_video_bitrate(&mut self, bitrate: &'static str) -> &mut Self {
|
||||
pub fn set_video_bitrate(&mut self, bitrate: u64) -> &mut Self {
|
||||
self.video_bitrate = Some(bitrate);
|
||||
self
|
||||
}
|
||||
|
@ -272,7 +272,7 @@ impl Ffmpeg {
|
|||
cmd.arg("-c:v").arg("copy");
|
||||
}
|
||||
if venc && self.video_bitrate.is_some() {
|
||||
cmd.arg("-b:v").arg(self.video_bitrate.unwrap());
|
||||
cmd.arg("-b:v").arg(self.video_bitrate.unwrap().to_string());
|
||||
}
|
||||
if aenc {
|
||||
cmd.arg("-c:a").arg("aac");
|
||||
|
|
|
@ -443,6 +443,15 @@ impl<'a> Renderer<'a> {
|
|||
|
||||
// we're done :)
|
||||
ffmpeg.set_filter_output(overlay);
|
||||
ffmpeg.set_video_bitrate(
|
||||
project
|
||||
.source
|
||||
.metadata
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.source_res
|
||||
.bitrate() * 3
|
||||
);
|
||||
ffmpeg.run()?;
|
||||
|
||||
Ok(output)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue