fade in/out worked out of the box :)
This commit is contained in:
parent
e36f13f11b
commit
c5cbc608f1
1 changed files with 50 additions and 2 deletions
|
@ -278,6 +278,56 @@ impl<'a> Renderer<'a> {
|
|||
});
|
||||
part2 = rectrim.into();
|
||||
|
||||
// fade out the intro
|
||||
let introfade = "introfade";
|
||||
ffmpeg.add_filter(Filter::Fade {
|
||||
input: part1,
|
||||
direction: "out",
|
||||
start: INTRO_LEN - TRANSITION_LEN,
|
||||
duration: TRANSITION_LEN,
|
||||
output: introfade.into()
|
||||
});
|
||||
part1 = introfade.into();
|
||||
|
||||
// fade in the recording
|
||||
let recfadein = "recfadein";
|
||||
ffmpeg.add_filter(Filter::Fade {
|
||||
input: part2,
|
||||
direction: "in",
|
||||
start: Time {
|
||||
seconds: 0,
|
||||
micros: 0
|
||||
},
|
||||
duration: TRANSITION_LEN,
|
||||
output: recfadein.into()
|
||||
});
|
||||
part2 = recfadein.into();
|
||||
|
||||
// fade out the recording
|
||||
let recfadeout = "recfadeout";
|
||||
ffmpeg.add_filter(Filter::Fade {
|
||||
input: part2,
|
||||
direction: "out",
|
||||
start: duration - TRANSITION_LEN,
|
||||
duration: TRANSITION_LEN,
|
||||
output: recfadeout.into()
|
||||
});
|
||||
part2 = recfadeout.into();
|
||||
|
||||
// fade in the outro
|
||||
let outrofade = "outrofade";
|
||||
ffmpeg.add_filter(Filter::Fade {
|
||||
input: part3,
|
||||
direction: "in",
|
||||
start: Time {
|
||||
seconds: 0,
|
||||
micros: 0
|
||||
},
|
||||
duration: TRANSITION_LEN,
|
||||
output: outrofade.into()
|
||||
});
|
||||
part3 = outrofade.into();
|
||||
|
||||
// fast-forward the requested parts in reverse order
|
||||
project.source.fast.sort();
|
||||
for (i, (ff_st, ff_end)) in project.source.fast.iter().rev().enumerate() {
|
||||
|
@ -293,8 +343,6 @@ impl<'a> Renderer<'a> {
|
|||
part2 = recff.into();
|
||||
}
|
||||
|
||||
// TODO fade
|
||||
|
||||
// concatenate everything
|
||||
let concat = "concat";
|
||||
ffmpeg.add_filter(Filter::Concat {
|
||||
|
|
Loading…
Reference in a new issue