Fix MOV and WEBM render transparency

This commit is contained in:
manongjohn 2021-04-22 08:10:59 -04:00
parent 39aa593c13
commit 1359000497
3 changed files with 5 additions and 3 deletions

View file

@ -85,7 +85,9 @@ TLevelWriterMov::~TLevelWriterMov() {
preIArgs << QString::number(m_frameRate);
postIArgs << "-pix_fmt";
postIArgs << "yuv420p";
postIArgs << "rgb24";
postIArgs << "-c:v";
postIArgs << "png";
postIArgs << "-s";
postIArgs << QString::number(outLx) + "x" + QString::number(outLy);
postIArgs << "-b";

View file

@ -171,7 +171,7 @@ bool RenderController::addScene(MovieGenerator &g, ToonzScene *scene) {
}
if (r1 < r0) return false;
TPixel color = scene->getProperties()->getBgColor();
if (m_movieExt == "mp4" || m_movieExt == "webm" || m_movieExt == "mov") color.m = 255;
if (isMovieType(m_movieExt) && m_movieExt != "mov" && m_movieExt != "webm") color.m = 255;
g.setBackgroundColor(color);
g.addScene(*scene, r0, r1);
return true;

View file

@ -439,7 +439,7 @@ void RenderCommand::rasterRender(bool isPreview) {
// depth). I tried to make OT to detect the mov settings and adaptively switch
// the behavior, but ended in vain :-(
// So I just omitted every mov from applying solid background as a quick fix.
if (isMovieType(ext)) {
if (isMovieType(ext) && ext != "mov" && ext != "webm") {
scene->getProperties()->setBgColor(currBgColor);
}
// for non alpha-enabled images (like jpg), background color will be inserted