render icon indicating copy to clipboard operation
render copied to clipboard

Support transperancy in .mov format

Open DariusRDev opened this issue 1 year ago • 3 comments

DariusRDev avatar Jun 20 '24 17:06 DariusRDev

I don't think .mov supports transparency. Please use .mp4 or in case I am wrong you may also update the .mov export file type with a pull request. (if it is supported by ffmpeg, it should not be a big problem)

polarby avatar Jun 20 '24 17:06 polarby

MOV does Support transparency. MP4 doesn't.

DariusRDev avatar Jun 21 '24 09:06 DariusRDev

use this code:



class TransparentMovFormat extends MovFormat {
  const TransparentMovFormat({
    super.audio,
    super.scale,
    super.interpolation = Interpolation.bicubic,
  }) : super();

  @override
  FFmpegRenderOperation processor({
    required String inputPath,
    required String outputPath,
    required double frameRate,
  }) {
    final audioInput = audio != null && audio!.isNotEmpty
        ? audio!.map((e) => "-i??${e.path}").join('??')
        : null;
    return FFmpegRenderOperation([
      "-y",
      "-i", inputPath,
      audioInput,
      "-filter_complex",
      "[0:v]${scalingFilter != null ? "$scalingFilter," : ""}"
          "setpts=N/($frameRate*TB)[v]",
      "-map", "[v]",
      "-c:v", "prores_ks",
      "-profile:v", "4444",
      "-pix_fmt", "yuva444p10le", // Enable alpha channel
      "-vendor", "ap10",
      "-colorspace", "bt709",
      "-movflags", "+faststart",
      "-r", "$frameRate",
      outputPath,
    ]);
  }
}

abujafari avatar Dec 31 '24 22:12 abujafari