make logo scale optional
This commit is contained in:
parent
e3d29c0659
commit
e8d1971686
@ -34,7 +34,9 @@ logging:
|
|||||||
pre_compress:
|
pre_compress:
|
||||||
helptext: Settings for the pre-compression. All clips get prepared in that way,
|
helptext: Settings for the pre-compression. All clips get prepared in that way,
|
||||||
so the input for the final compression is unique. 'aspect' must be a float
|
so the input for the final compression is unique. 'aspect' must be a float
|
||||||
number. 'logo' is only used if the path exist. With 'logo_opacity' logo can
|
number. 'logo' is only used if the path exist. 'logo_scale' scale the logo to
|
||||||
|
target size, leave it blank when no scaling is needed, format is 'number:number',
|
||||||
|
for example '100:-1' for proportional scaling. With 'logo_opacity' logo can
|
||||||
become transparent. With 'logo_filter' 'overlay=W-w-12:12' you can modify
|
become transparent. With 'logo_filter' 'overlay=W-w-12:12' you can modify
|
||||||
the logo position. With 'use_loudnorm' you can activate single pass EBU R128
|
the logo position. With 'use_loudnorm' you can activate single pass EBU R128
|
||||||
loudness normalization. 'loud_*' can adjust the loudnorm filter. [Output is
|
loudness normalization. 'loud_*' can adjust the loudnorm filter. [Output is
|
||||||
@ -45,7 +47,7 @@ pre_compress:
|
|||||||
fps: 25
|
fps: 25
|
||||||
add_logo: True
|
add_logo: True
|
||||||
logo: "docs/logo.png"
|
logo: "docs/logo.png"
|
||||||
logo_scale: "100:-1"
|
logo_scale:
|
||||||
logo_opacity: 0.7
|
logo_opacity: 0.7
|
||||||
logo_filter: "overlay=W-w-12:12"
|
logo_filter: "overlay=W-w-12:12"
|
||||||
add_loudnorm: False
|
add_loudnorm: False
|
||||||
|
@ -19,10 +19,10 @@
|
|||||||
|
|
||||||
import math
|
import math
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
|
|
||||||
from .utils import _pre_comp
|
from .utils import _pre_comp
|
||||||
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# building filters,
|
# building filters,
|
||||||
# when is needed add individuell filters to match output format
|
# when is needed add individuell filters to match output format
|
||||||
@ -116,14 +116,18 @@ def overlay_filter(duration, ad, ad_last, ad_next):
|
|||||||
when clip before was an ad fade logo in
|
when clip before was an ad fade logo in
|
||||||
"""
|
"""
|
||||||
logo_filter = '[v]null[logo]'
|
logo_filter = '[v]null[logo]'
|
||||||
|
scale_filter = ''
|
||||||
|
|
||||||
if _pre_comp.add_logo and os.path.isfile(_pre_comp.logo) and not ad:
|
if _pre_comp.add_logo and os.path.isfile(_pre_comp.logo) and not ad:
|
||||||
logo_chain = []
|
logo_chain = []
|
||||||
opacity = 'format=rgba,scale={},colorchannelmixer=aa={}'.format(
|
if _pre_comp.logo_scale and \
|
||||||
_pre_comp.logo_scale, _pre_comp.logo_opacity)
|
re.match(r'\d+:-?\d+', _pre_comp.logo_scale):
|
||||||
|
scale_filter = 'scale={},'.format(_pre_comp.logo_scale)
|
||||||
|
logo_extras = 'format=rgba,{}colorchannelmixer=aa={}'.format(
|
||||||
|
scale_filter, _pre_comp.logo_opacity)
|
||||||
loop = 'loop=loop=-1:size=1:start=0'
|
loop = 'loop=loop=-1:size=1:start=0'
|
||||||
logo_chain.append(
|
logo_chain.append(
|
||||||
'movie={},{},{}'.format(_pre_comp.logo, loop, opacity))
|
'movie={},{},{}'.format(_pre_comp.logo, loop, logo_extras))
|
||||||
if ad_last:
|
if ad_last:
|
||||||
logo_chain.append('fade=in:st=0:d=1.0:alpha=1')
|
logo_chain.append('fade=in:st=0:d=1.0:alpha=1')
|
||||||
if ad_next:
|
if ad_next:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user