Bug 391963 - Some transparent clips appears with black background on timeline or in Project bin
Summary: Some transparent clips appears with black background on timeline or in Projec...
Status: RESOLVED FIXED
Alias: None
Product: kdenlive
Classification: Applications
Component: Video Display & Export (show other bugs)
Version: 17.12.3
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-17 12:59 UTC by Andrew Shark
Modified: 2018-04-11 13:41 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Videos encoded in different codecs with transparent background (2.48 MB, application/gzip)
2018-03-17 12:59 UTC, Andrew Shark
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Shark 2018-03-17 12:59:05 UTC
Created attachment 111460 [details]
Videos encoded in different codecs with transparent background

I am going to make motion graphics in Adobe After Effects or Apple Motion and use it in kdenlive. I have explored available export video formats, because I feel it more comfortable than image sequences.

Some codecs are not transparent in Kdenlive timeline and one codec is not transparent in project bin clip icon.

I have tested all available standard export codecs in Ae which support alpha (except DNxHD/DNxHR) and additionally I have installed TechSmith Screen Capture codec v1 in Windows. It also supports transparency and became available to export using it in Ae. In Motion I have tested ProRes 4444 and Animation (via Apple Compressor settings) codecs.

Here is list of issues that I have found in format
Container - Codec - What's wrong - ffmpeg supports alpha:
Avi - tscc - bbg*, bbgpb* - probably not**
QuickTime - GoPro CineForm - bbg - yes
QuickTime - ProRes 4444 - bbg - yes

* bbg - means black background in timeline when placing above some clip instead of transparent background
* bbgpb - black bg in project bin in clip icon instead of transparent

** I have tested if ffmpeg itself supports transparency for the codec. I used a command like this:
ffmpeg -i normal_video.mp4 -i motion_graphics_with_transparent_bg.mov -filter_complex "[0:v][1:v] overlay=25:25" -pix_fmt yuv420p -c:a copy output.mp4
It worked for both mentioned codecs in quicktime, but did not work for Avi-tscc. Maybe ffmpeg just do not support transparency for tscc? How can I know that for sure? Because I would prefer tscc over Quicktime-Animation, because it compresses file size much-much better.

Sample videos encoded with problematic codecs are attached in tar archive. Additionally there is quicktime-animation sample, which appears transparent in kdenlive, as expected.
TSCC codec for windows is available here: https://www.techsmith.com/codecs.html
Comment 1 Andrew Shark 2018-03-22 20:53:28 UTC
I have tested mlt for supporting transparency in these codecs. I used the following command:
melt normal_video.mp4 -track <file> -transition affine
where <file> is a png or video file with transparency.
Result is the same as for ffmpeg. Here is a table of results:

+-----------------+--------+-----+----------+
| container-codec | ffmpeg | mlt | kdenlive |
+-----------------+--------+-----+----------+
|     png-none    |   yes  | yes |    yes   |
+-----------------+--------+-----+----------+
|   qt-animation  |   yes  | yes |    yes   |
+-----------------+--------+-----+----------+
|     avi-tscc    |   no   |  no |    no    |
+-----------------+--------+-----+----------+
|    qt-prores    |   yes  | yes |    no    |
+-----------------+--------+-----+----------+
|   qt-cineform   |   yes  | yes |    no    |
+-----------------+--------+-----+----------+

So I can say that the fact that kdenlive is not supporting qt-prores and qt-cineform is definitely a bug. And tscc is probably ffmpeg's unimplemented feature.
Comment 2 Jean-Baptiste Mardelle 2018-03-23 07:51:27 UTC
Thanks for your detailed report. It is indeed a bug in MLT's qtblend transition that I wrote. It does not correctly detect the alpha channel. I am investigating, but in the meantime, as a workaround you can add a transition to your clips, like cairo blend to force the alpha compositing.
Comment 3 Andrew Shark 2018-03-23 08:27:45 UTC
Thanks for reply and for suggestion.
I did not know that you are also a developer of mlt. Great respect to you =)!
Comment 4 Jean-Baptiste Mardelle 2018-04-11 13:41:51 UTC
Now fixed in MLT's git master