Opened 4 years ago

Last modified 3 years ago

#6718 reopened enhancement

Option to remove label on alpha channel

Reported by: ttdww Owned by:
Priority: wish Component: undetermined
Version: unspecified Keywords: alpha
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

When FFMPEG writes to RGBA PNG 32bit .MOV Quicktime, it seems to label alpha to be interpreted as 'straight' when we need the files to have 'no label' so After effects can remember it's own interpretation setting for 'Import of an unlabeled alpha'. Otherwise users will constantly have to force the interpretation of every FFMPEG created PNG file they import regardless of what After Effects is set to.

Version of FFMPEG: ffmpeg-20170921-183fd30-win64-static

How to reproduce:
ffmpeg.exe -r 24 -f image2 "explosion.%%04d.exr" -vcodec png -pix_fmt rgba -y "explosion.mov"

If we are doing something wrong, we apologize. We have searched far and wide for an answer.

Attachments (4)

Test_01_32bitPNG_PremultipliedAlpha.mov (219.9 KB ) - added by Carl Eugen Hoyos 3 years ago.
Test_02_32bitPNG_StraightAlpha.mov (223.3 KB ) - added by Carl Eugen Hoyos 3 years ago.
Test_03_8bitPNG_Alpha.mov (214.3 KB ) - added by Carl Eugen Hoyos 3 years ago.
Test_03_24bitPNG_Ignored_NoAlpha_RGBonly.mov (197.9 KB ) - added by Carl Eugen Hoyos 3 years ago.

Download all attachments as: .zip

Change History (19)

comment:1 by Carl Eugen Hoyos, 4 years ago

Keywords: label interpret removed
Priority: importantwish
Type: taskenhancement

comment:2 by ttdww, 4 years ago

Hi Cehoyos,

Since I see this was changed from bug to wish, I'm guessing there is no way to control this currently?

From other programs we've used here, 3ds max, After Effects, etc., the alpha channel of most QT files outputted is always 'unlabeled', so we're hoping this can be added to FFMPEG soon. For now, we're going to have to keep command-line AE in our workflow to process files.

Thanks again for your time.

comment:3 by ttdww, 4 years ago

I'm seeing something in the docs about -vf unpremultiply (http://ffmpeg.org/ffmpeg-filters.html#toc-unpremultiply) though I'm not clear on how to use it with switches.

Perhaps an example would help us. Thanks!

comment:4 by ttdww, 4 years ago

Ok, that only affects the input. The output file still have alpha labeled as 'straight'.

comment:5 by Carl Eugen Hoyos, 4 years ago

Will the change affect the png encoder or the mov muxer?

comment:6 by ttdww, 4 years ago

I'm thinking the mov muxer overall? Or even beyond that, it could affect any filetype that supports outputted alpha (Quicktime PNG, QT Animation, EXR, TGA..). However the primary issue for us, currently, is to have it work with PNG RGBA.

[Edit] I realize now I may have misunderstood your question. If you are asking me if it will affect either one of those or both, I'm not sure.

Last edited 4 years ago by ttdww (previous) (diff)

comment:7 by ttdww, 4 years ago

From what I'm understanding, some filetypes (not sure which ones, but definitely Quicktime PNG 32bit) can get a property or metadata string added to the file which defines how the alpha should be interpreted. Most programs I've seen that output PNG don't add one so that the image editing app importing it can force it to it's own setting per that app. Somehow when FFMPEG is writing it, it seems it's getting that property added and set to 'straight'. This is my best guess, however I'm not a coder.

Last edited 4 years ago by ttdww (previous) (diff)

comment:8 by ttdww, 4 years ago

Hi,

Was that a question for me?

in reply to:  7 comment:9 by Carl Eugen Hoyos, 4 years ago

Replying to ttdww:

From what I'm understanding, some filetypes (not sure which ones, but definitely Quicktime PNG 32bit) can get a property

My question was (if you know) if the property - that you originally called a label - is part of the mov file or the png images inside. It is unlikely that it is a property of both.

comment:10 by ttdww, 4 years ago

So sorry, I'm not sure. I'm just a graphics artist and CEO but not so much a coder.

I only know that when a program (in this case FFmpeg) writes a Quicktime file from a string of 32bit images (.EXR, .TGA, or .PNG in this case), the alpha channel in the input image string may be labeled or unlabeled (as to how to use the alpha) and then can be labeled or set to unlabeled when a Quicktime file is written. There needs to be an option when writing the QT file (in this case a 32bit PNG) to leave the alpha 'unlabeled'. Currently FFmpeg sets the alpha in the QT file to 'straight' which many companies don't use when compositing for movies, games, TV, etc - or at least they need it to be 'unlabeled'.

The problem is that when a company like ours supplies them with hundreds of QT files, after the import of the first QT file, as long as the alpha is unlabeled they can choose the method they want: 'ignore alpha, straight, or premultiplied'. Then the rest of the QT files will grab that default as they import. If the alpha is already labeled (in the case of how FFmpeg currently writes them, it forces it to 'straight'), then the client will have to manually set each and every QT file to their preference, hence making the QT files not very usable.

Thanks again! Sorry, hope all that makes sense. We're really hoping to ditch After Effects command-line processing and solely use FFmpeg if we could just get this resolved.

Last edited 4 years ago by ttdww (previous) (diff)

comment:11 by Carl Eugen Hoyos, 4 years ago

Please provide short (!) files with ignored, straight and premultiplied alpha (identical except for the alpha label).

comment:12 by ttdww, 4 years ago

Will do. Thanks very much.

comment:13 by ttdww, 4 years ago

Here you go: http://finalight.com/download/x3a4j5hv2x34x5hf4j6g5x8w34kjbv34z/mov_tests_withAlpha.zip

I wasn't sure how to create a 32bit .mov with alpha ignored but while still retaining the alpha in the file, so I went ahead with it set to ignored which outputs only RGB with no alpha; then included the alpha as a separate 8bit .mov.

Let me know if this isn't what you need.

Thanks again!

comment:14 by Elon Musk, 3 years ago

Resolution: needs_more_info
Status: newclosed

File is gone.

by Carl Eugen Hoyos, 3 years ago

by Carl Eugen Hoyos, 3 years ago

by Carl Eugen Hoyos, 3 years ago

Attachment: Test_03_8bitPNG_Alpha.mov added

by Carl Eugen Hoyos, 3 years ago

comment:15 by Carl Eugen Hoyos, 3 years ago

Resolution: needs_more_info
Status: closedreopened

Files are attached now.

Note: See TracTickets for help on using tickets.