diff --git a/src/render/mod.rs b/src/render/mod.rs index 4fb17cd..e8b6729 100644 --- a/src/render/mod.rs +++ b/src/render/mod.rs @@ -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 {