Correct Video Layer Setting for Transparency Channel (AVI)
-
- Posts: 108
- Joined: Fri May 08, 2020 5:18 pm
Correct Video Layer Setting for Transparency Channel (AVI)
Hello,
Would somebody please tell me what are the correct settings I should use in Adobe Premier to export an AVI with transparency?
I tried quite a few settings over the last hour and had no success.
Thanks
Would somebody please tell me what are the correct settings I should use in Adobe Premier to export an AVI with transparency?
I tried quite a few settings over the last hour and had no success.
Thanks
Re: Correct Video Layer Setting for Transparency Channel (AVI)
Hi,
I think Microsoft RLE or Uncompressed 422 should be ok but check your file size cause it's gonna be huge
I think Microsoft RLE or Uncompressed 422 should be ok but check your file size cause it's gonna be huge
-
- Posts: 108
- Joined: Fri May 08, 2020 5:18 pm
RE: Correct Video Layer Setting for Transparency Channel (AVI)
Well obviously premiere does not offer any general purpose codec with alpha channel in avi container, you'd need to look out for something with a 4th component like 4:4:4:4 or yuva or rgba
Question is why you are bound using avi container, it is probably the oldest, most limited one you can go for
Why not use mov instead or such? Which target software does support alpha in avi anyways?
One alternative way for working with formats that don't support alpha is to export 2 versions, key and fill into separate files.
Some example ffmpeg commands for working with separate key and fill files:
*) map Y from yuv (alpha only, grayscale) file to new file with a real alpha channel:
*) Merge key and fill from 2 separate yuv files into one (ffastrans layer compatible avi). This is something we occasionally do at broadcast, as SDI signal doesnt carry alpha, we store alpha in a separate file. Here is how we can work with it:
Note that instead of -c:v rawvideo you could also do any other codec with alpha, e.g. -c:v prores_ks -pix_fmt yuva444p10l
*) Finally, when we have all components in a single file, use it for overlaying onto some other video (same as layer processor does but compatible to more file formats with alpha):
Question is why you are bound using avi container, it is probably the oldest, most limited one you can go for
Why not use mov instead or such? Which target software does support alpha in avi anyways?
One alternative way for working with formats that don't support alpha is to export 2 versions, key and fill into separate files.
Some example ffmpeg commands for working with separate key and fill files:
*) map Y from yuv (alpha only, grayscale) file to new file with a real alpha channel:
Code: Select all
ffmpeg -i E:\temp\kf\WIPE02_KEY.mxf -filter_complex format=yuva444p,mergeplanes=0x03010200:yuva444p[4c];[4c]alphaextract -c:v prores_ks -pix_fmt yuva444p10le e:\temp\kf\withalpha.mov
Code: Select all
ffmpeg -i e:\temp\kf\WIPE02_KEY.mxf -i E:\temp\kf\WIPE02_FILL.mxf -filter_complex format=yuva444p,mergeplanes=0x03010200:yuva444p[4c];[4c]alphaextract[1c];[1][1c]alphamerge[out] -map [out] -c:v rawvideo -pix_fmt rgba e:\temp\kf\merged.avi
*) Finally, when we have all components in a single file, use it for overlaying onto some other video (same as layer processor does but compatible to more file formats with alpha):
Code: Select all
ffmpeg -y -i e:\5.1.mp4 -i e:\temp\kf\merged.avi -filter_complex [0][1]overlay[v1] -map [v1] -map 0:a -c:a copy -c:v libx264 -preset ultrafast -shortest e:\temp\kf\finaloutput.mp4
emcodem, wrapping since 2009 you got the rhyme?
Re: Correct Video Layer Setting for Transparency Channel (AVI)
Hi authorleon,
In Premiere you must use "None" as video codec and set to 32 bit depth. It should give you a proper rgba file.
-steinar
In Premiere you must use "None" as video codec and set to 32 bit depth. It should give you a proper rgba file.
-steinar
-
- Posts: 108
- Joined: Fri May 08, 2020 5:18 pm
Re: Correct Video Layer Setting for Transparency Channel (AVI)
first of all thank you for the post second of all let me try that and now get back to you and I will respond to emcodem.
Thank you
Thank you
-
- Posts: 108
- Joined: Fri May 08, 2020 5:18 pm
Re: Correct Video Layer Setting for Transparency Channel (AVI)
okay, I finally got it working. There was a setting that was set to 24-bit as opposed to 32-bit.
I have a question. The file sizes are colossal. Is there any alternative?
thanks
I have a question. The file sizes are colossal. Is there any alternative?
thanks
-
- Posts: 108
- Joined: Fri May 08, 2020 5:18 pm
Re: Correct Video Layer Setting for Transparency Channel (AVI)
Wow. Thanks. I will need to go through this in detail!
-
- Posts: 108
- Joined: Fri May 08, 2020 5:18 pm
Re: Correct Video Layer Setting for Transparency Channel (AVI)
Hello all:
I have a question. The file sizes are colossal. Is there any alternative? Smaller file size?
Thank you
PS: @emcodem, thank you for the info. But that is a little too complex at present.
I have a question. The file sizes are colossal. Is there any alternative? Smaller file size?
Thank you
PS: @emcodem, thank you for the info. But that is a little too complex at present.
Re: Correct Video Layer Setting for Transparency Channel (AVI)
Yeah sorry, sure you dont want to work with separate files, i just added my ffmpeg commands in order to preserve them next time when i need them
The reason why we only support uncompressed avi is that the videolayer processor is an unloved stepchild, it uses the avisynth source plugin "Avisource". But as far as i see, the "eat everything" source plugin ffvideosource also supports alpha channel these days.
So why don't we just try to replace the word "Avisource" by "ffvideosource" directly after the videolayer node?
Here is how i generated a small webm video from a transparent png for testing, you need to test which format + alpha from premiere is supported by ffvideosource (e.g. quicktime animation?).
Here the workflow, it reads the .avs script after the videolayer node (%s_source%), replaces "Avisource" against "FFvideosource", writes the result to a file in work_folder and sets %s_source% to the resulting avs script. Tested with above webm transparent source, works for me.
Of course we can alternatively take a custom avs processor and recreate what the videolayer proc does. Looking at the source code of the videolayer processor, there is no logic at all, so basically it is just a convenience function for inserting these lines into the avs script (but it uses avisource instead of ffvideosource):
NOT TESTED:
Edit: if the alpha source is interlaced, use ConvertToRGB32(m_clip, interlaced=true)
The reason why we only support uncompressed avi is that the videolayer processor is an unloved stepchild, it uses the avisynth source plugin "Avisource". But as far as i see, the "eat everything" source plugin ffvideosource also supports alpha channel these days.
So why don't we just try to replace the word "Avisource" by "ffvideosource" directly after the videolayer node?
Here is how i generated a small webm video from a transparent png for testing, you need to test which format + alpha from premiere is supported by ffvideosource (e.g. quicktime animation?).
Code: Select all
ffmpeg -loop 1 -i Desktop\transparent.png -r 30 -pix_fmt yuva420p c:\temp\transpavideo.webm
Of course we can alternatively take a custom avs processor and recreate what the videolayer proc does. Looking at the source code of the videolayer processor, there is no logic at all, so basically it is just a convenience function for inserting these lines into the avs script (but it uses avisource instead of ffvideosource):
NOT TESTED:
Code: Select all
m_clip = ConvertTo8Bit(m_clip)
videolayer = FFVideoSource("C:\Users\emcod\Desktop\transparent.webm").converttorgb32().LanczosResize(m_clip.Width, m_clip.Height).ConvertFPS(m_clip.FrameRate)
audiolayer = BlankClip(m_clip, length = videolayer.FrameCount, color=$000000)
medialayer = AudioDub(videolayer, audiolayer)
m_clip = ConvertToRGB32(m_clip)
m_clip = Layer(m_clip,medialayer, "add", Round(254))
m_clip = ConvertToYUV444(m_clip)
Return m_clip
emcodem, wrapping since 2009 you got the rhyme?