Skip to contentSkip to conversation

ffmpeg: make LICENSE_FLAGS fine-grained

RFC PATCH In review Yann Dirson 3 participants 7 messages Mar 23, 2021 – Mar 26, 2021 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 ffmpeg: make LICENSE_FLAGS fine-grained

From: Yann Dirson <[email protected]>

The rationale here is that if the user can only whitelist "commercial" to use any part of ffmpeg, even it the list of features is carefully reviewed when switching the whitelisting on, there was nothing to guard from inadvertently activating a new feature that would not have been reviewed.

This patch adds one LICENSE_FLAGS value for each feature, except for those that bring no codec, trying to be on the same level of legal safety - but then I may miss something.

I tried to leave out of the safe NONCOMMERCIAL_PACKAGECONFIGS list anything that brings a codec, notably libavcodec. I also did not look at non-default features yet.

There may still be a problem if any feature in ffmpeg gets activated by default upstream and not registed as a PACKAGECONFIG feature. At least any of those that depend on another lib would not be enabled, that could be seen as a sufficient safeguard.

---
 meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb +11 -1
index 08be38ca50..3a36c95151 100644
@@ -16,7 +16,17 @@ LICENSE_libavutil = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGP
 LICENSE_libpostproc = "GPLv2+"
 LICENSE_libswresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
 LICENSE_libswscale = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
-LICENSE_FLAGS = "commercial"
+
+# PACKAGECONFIG features that do not pull codecs
+NONCOMMERCIAL_PACKAGECONFIGS = " \
+ alsa bzlib drm gpl lzma zlib xcb xv \
+ avdevice avfilter avformat swresample swscale postproc avresample \
+"
+# An ffmpeg feature not in NONCOMMERCIAL_PACKAGECONFIGS should be explicitly whitelisted.
+# See https://ffmpeg.org/legal.html
+LICENSE_FLAGS = "${@' '.join('commercial_' + cfg \
+                             for cfg in '${PACKAGECONFIG}'.split() \
+                             if cfg not in '${NONCOMMERCIAL_PACKAGECONFIGS}'.split())}"
 
 LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
                     file://COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
Signature · 1 line
2.30.2
#1 lore raw

Is it possible to further split the NONCOMMERCIAL_PACKAGECONFIGS into ones that are enabled and disabled, and use the former in PACKAGECONFIG itself?

Alex

Quoted 62 lines · Yann Dirson

From: Yann Dirson <[email protected]>

The rationale here is that if the user can only whitelist "commercial" to use any part of ffmpeg, even it the list of features is carefully reviewed when switching the whitelisting on, there was nothing to guard from inadvertently activating a new feature that would not have been reviewed.

This patch adds one LICENSE_FLAGS value for each feature, except for those that bring no codec, trying to be on the same level of legal safety - but then I may miss something.

I tried to leave out of the safe NONCOMMERCIAL_PACKAGECONFIGS list anything that brings a codec, notably libavcodec. I also did not look at non-default features yet.

There may still be a problem if any feature in ffmpeg gets activated by default upstream and not registed as a PACKAGECONFIG feature. At least any of those that depend on another lib would not be enabled, that could be seen as a sufficient safeguard.

---
 meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb +0 -0
index 08be38ca50..3a36c95151 100644
@@ -16,7 +16,17 @@ LICENSE_libavutil =

"${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGP
LICENSE_libpostproc = "GPLv2+"
LICENSE_libswresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl',
'GPLv2+', 'LGPLv2.1+', d)}"
LICENSE_libswscale = "${@bb.utils.contains('PACKAGECONFIG', 'gpl',
'GPLv2+', 'LGPLv2.1+', d)}"

meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb +7 -1
-LICENSE_FLAGS = "commercial"
+
+# PACKAGECONFIG features that do not pull codecs
+NONCOMMERCIAL_PACKAGECONFIGS = " \
+ alsa bzlib drm gpl lzma zlib xcb xv \
+ avdevice avfilter avformat swresample swscale postproc avresample \
+"
+# An ffmpeg feature not in NONCOMMERCIAL_PACKAGECONFIGS should be

explicitly whitelisted.

meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb +4 -0
+# See https://ffmpeg.org/legal.html
+LICENSE_FLAGS = "${@' '.join('commercial_' + cfg \
+                             for cfg in '${PACKAGECONFIG}'.split() \
+                             if cfg not in

'${NONCOMMERCIAL_PACKAGECONFIGS}'.split())}"

LIC_FILES_CHKSUM =
"file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \

file://COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
--
2.30.2

#2 lore raw

Hi all,

Quoted 48 lines · Alexander Kanavin

Is it possible to further split the NONCOMMERCIAL_PACKAGECONFIGS into ones that are enabled and disabled, and use the former in PACKAGECONFIG itself?

Alex

Quoted 40 lines · Yann Dirson

From: Yann Dirson <[email protected]>

The rationale here is that if the user can only whitelist "commercial" to use any part of ffmpeg, even it the list of features is carefully reviewed when switching the whitelisting on, there was nothing to guard from inadvertently activating a new feature that would not have been reviewed.

This patch adds one LICENSE_FLAGS value for each feature, except for those that bring no codec, trying to be on the same level of legal safety - but then I may miss something.

I tried to leave out of the safe NONCOMMERCIAL_PACKAGECONFIGS list anything that brings a codec, notably libavcodec. I also did not look at non-default features yet.

There may still be a problem if any feature in ffmpeg gets activated by default upstream and not registed as a PACKAGECONFIG feature. At least any of those that depend on another lib would not be enabled, that could be seen as a sufficient safeguard.

---
 meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb +0 -0
index 08be38ca50..3a36c95151 100644
@@ -16,7 +16,17 @@ LICENSE_libavutil =

"${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGP
LICENSE_libpostproc = "GPLv2+"
LICENSE_libswresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl',
'GPLv2+', 'LGPLv2.1+', d)}"
LICENSE_libswscale = "${@bb.utils.contains('PACKAGECONFIG', 'gpl',
'GPLv2+', 'LGPLv2.1+', d)}"

meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb +3 -1
-LICENSE_FLAGS = "commercial"
+
+# PACKAGECONFIG features that do not pull codecs
+NONCOMMERCIAL_PACKAGECONFIGS = " \
Quoted 8 lines

meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb LICENSE_libavutil = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGP · line 28

Quoted 8 lines

+ alsa bzlib drm gpl lzma zlib xcb xv \
+ avdevice avfilter avformat swresample swscale postproc avresample \
+"
+# An ffmpeg feature not in NONCOMMERCIAL_PACKAGECONFIGS should be explicitly whitelisted.

meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb +3 -0
+# See https://ffmpeg.org/legal.html
+LICENSE_FLAGS = "${@' '.join('commercial_' + cfg \
+                             for cfg in '${PACKAGECONFIG}'.split() \

I would at least make it commercial_ffmpeg- + cfg. To make it obvious that it belongs to ffmpeg recipe/packages.

I guess it breaks backward compatibility, which IMO is fine unless there is a possibility someone who blacklisted this commercial license in some way now has it enabled. I don't know enough about the inner workings of LICENSE_FLAGS so cannot say if this is covered or not.

Quentin

#3 lore raw
Quoted 55 lines · Quentin Schulz

Hi all,

Quoted 51 lines · Alexander Kanavin

Is it possible to further split the NONCOMMERCIAL_PACKAGECONFIGS into ones that are enabled and disabled, and use the former in PACKAGECONFIG itself?

Alex

Quoted 43 lines · Yann Dirson

From: Yann Dirson <[email protected]>

The rationale here is that if the user can only whitelist "commercial" to use any part of ffmpeg, even it the list of features is carefully reviewed when switching the whitelisting on, there was nothing to guard from inadvertently activating a new feature that would not have been reviewed.

This patch adds one LICENSE_FLAGS value for each feature, except for those that bring no codec, trying to be on the same level of legal safety - but then I may miss something.

I tried to leave out of the safe NONCOMMERCIAL_PACKAGECONFIGS list anything that brings a codec, notably libavcodec. I also did not look at non-default features yet.

There may still be a problem if any feature in ffmpeg gets activated by default upstream and not registed as a PACKAGECONFIG feature. At least any of those that depend on another lib would not be enabled, that could be seen as a sufficient safeguard.

---
 meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb +0 -0
index 08be38ca50..3a36c95151 100644
@@ -16,7 +16,17 @@ LICENSE_libavutil =

"${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGP
LICENSE_libpostproc = "GPLv2+"
LICENSE_libswresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl',
'GPLv2+', 'LGPLv2.1+', d)}"
LICENSE_libswscale = "${@bb.utils.contains('PACKAGECONFIG', 'gpl',
'GPLv2+', 'LGPLv2.1+', d)}"

meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb +6 -1
-LICENSE_FLAGS = "commercial"
+
+# PACKAGECONFIG features that do not pull codecs
+NONCOMMERCIAL_PACKAGECONFIGS = " \
+ alsa bzlib drm gpl lzma zlib xcb xv \
+ avdevice avfilter avformat swresample swscale postproc avresample \
+"
Quoted 8 lines
Quoted 5 lines

meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb LICENSE_libavutil = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGP · line 28

Quoted 5 lines

+# An ffmpeg feature not in NONCOMMERCIAL_PACKAGECONFIGS should be explicitly whitelisted.

meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb +3 -0
+# See https://ffmpeg.org/legal.html
+LICENSE_FLAGS = "${@' '.join('commercial_' + cfg \
+                             for cfg in '${PACKAGECONFIG}'.split() \

I would at least make it commercial_ffmpeg- + cfg. To make it obvious that it belongs to ffmpeg recipe/packages.

Makes sense.

Quoted 5 lines

I guess it breaks backward compatibility, which IMO is fine unless there is a possibility someone who blacklisted this commercial license in some way now has it enabled. I don't know enough about the inner workings of LICENSE_FLAGS so cannot say if this is covered or not.

You mean, that "commercial" would be whitelisted globally, but then something would
exclude ffmpeg from that whitelist ? I'm not aware of a way to do that.

If someone whitelisted it, it should be with one of "commercial", "commercial_ffmpeg",
or "commercial_ffmpeg_${PV}". It is likely hard to get the 3rd one to work, but in any case
the compatibility breakage would result in an early build failure, so I guess it will be
acceptable.

Signature · 2 lines
Yann Dirson <[email protected]>
Blade / Shadow -- http://shadow.techAFA
#4 lore raw
Quoted 69 lines · Yann Dirson
Quoted 55 lines · Quentin Schulz

Hi all,

Quoted 51 lines · Alexander Kanavin

Is it possible to further split the NONCOMMERCIAL_PACKAGECONFIGS into ones that are enabled and disabled, and use the former in PACKAGECONFIG itself?

Alex

Quoted 43 lines · Yann Dirson

From: Yann Dirson <[email protected]>

The rationale here is that if the user can only whitelist "commercial" to use any part of ffmpeg, even it the list of features is carefully reviewed when switching the whitelisting on, there was nothing to guard from inadvertently activating a new feature that would not have been reviewed.

This patch adds one LICENSE_FLAGS value for each feature, except for those that bring no codec, trying to be on the same level of legal safety - but then I may miss something.

I tried to leave out of the safe NONCOMMERCIAL_PACKAGECONFIGS list anything that brings a codec, notably libavcodec. I also did not look at non-default features yet.

There may still be a problem if any feature in ffmpeg gets activated by default upstream and not registed as a PACKAGECONFIG feature. At least any of those that depend on another lib would not be enabled, that could be seen as a sufficient safeguard.

---
 meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb +0 -0
index 08be38ca50..3a36c95151 100644
@@ -16,7 +16,17 @@ LICENSE_libavutil =

"${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGP
LICENSE_libpostproc = "GPLv2+"
LICENSE_libswresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl',
'GPLv2+', 'LGPLv2.1+', d)}"
LICENSE_libswscale = "${@bb.utils.contains('PACKAGECONFIG', 'gpl',
'GPLv2+', 'LGPLv2.1+', d)}"

meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb +6 -1
-LICENSE_FLAGS = "commercial"
+
+# PACKAGECONFIG features that do not pull codecs
+NONCOMMERCIAL_PACKAGECONFIGS = " \
+ alsa bzlib drm gpl lzma zlib xcb xv \
+ avdevice avfilter avformat swresample swscale postproc avresample \
+"
Quoted 8 lines
Quoted 5 lines

meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb LICENSE_libavutil = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGP · line 28

Quoted 5 lines

+# An ffmpeg feature not in NONCOMMERCIAL_PACKAGECONFIGS should be explicitly whitelisted.

meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb +3 -0
+# See https://ffmpeg.org/legal.html
+LICENSE_FLAGS = "${@' '.join('commercial_' + cfg \
+                             for cfg in '${PACKAGECONFIG}'.split() \

I would at least make it commercial_ffmpeg- + cfg. To make it obvious that it belongs to ffmpeg recipe/packages.

Makes sense.

Quoted 1 line
Quoted 9 lines
Quoted 4 lines

I guess it breaks backward compatibility, which IMO is fine unless there is a possibility someone who blacklisted this commercial license in some way now has it enabled. I don't know enough about the inner workings of LICENSE_FLAGS so cannot say if this is covered or not.

You mean, that "commercial" would be whitelisted globally, but then something would
exclude ffmpeg from that whitelist ? I'm not aware of a way to do that.

That was exactly what I meant. No idea either if such a mechanism exists.

Cheers,
Quentin

#5 lore raw
In reply to Alexander Kanavin

Hi Alex,

Quoted 2 lines · Alexander Kanavin

Is it possible to further split the NONCOMMERCIAL_PACKAGECONFIGS into ones that are enabled and disabled, and use the former in PACKAGECONFIG itself?

You mean something like this ?

# PACKAGECONFIG features that do not pull codecs NONCOMMERCIAL_DEFAULT_PACKAGECONFIGS = " \
avdevice avfilter avformat swresample swscale postproc avresample \
alsa bzlib drm gpl lzma pic pthreads shared zlib \
${@bb.utils.contains('AVAILTUNES', 'mips32r2', 'mips32r2', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xv xcb', '', d)} \
"
NONCOMMERCIAL_NONDEFAULT_PACKAGECONFIGS = " \
altivec bzlib gsm jack openssl sdl2 \
"

PACKAGECONFIG ??= "avcodec theora \
                   ${NONCOMMERCIAL_DEFAULT_PACKAGECONFIGS}"

I admit I'm not completely sure about every feature's status.

I tend to think that if ffmpeg relies on a lib providing an implementation, and there
are patent-related risks, it should that lib setting a LICENSE_FLAG. Eg. x264 and others
already sets the "commercial" flag, so I'm tempted to not add a duplicate flag in
ffmpeg (in the same spirit as my patches against gst-libav and mpv). Would it be
good enough ?

Quoted 59 lines

Alex

Quoted 54 lines · Yann Dirson

From: Yann Dirson <[email protected]>

The rationale here is that if the user can only whitelist "commercial" to use any part of ffmpeg, even it the list of features is carefully reviewed when switching the whitelisting on, there was nothing to guard from inadvertently activating a new feature that would not have been reviewed.

This patch adds one LICENSE_FLAGS value for each feature, except for those that bring no codec, trying to be on the same level of legal safety - but then I may miss something.

I tried to leave out of the safe NONCOMMERCIAL_PACKAGECONFIGS list anything that brings a codec, notably libavcodec. I also did not look at non-default features yet.

There may still be a problem if any feature in ffmpeg gets activated by default upstream and not registed as a PACKAGECONFIG feature. At least any of those that depend on another lib would not be enabled, that could be seen as a sufficient safeguard.

---
 meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb +11 -2
index 08be38ca50..3a36c95151 100644
@@ -16,7 +16,17 @@ LICENSE_libavutil = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGP
 LICENSE_libpostproc = "GPLv2+"
 LICENSE_libswresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
 LICENSE_libswscale = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
-LICENSE_FLAGS = "commercial"
+
+# PACKAGECONFIG features that do not pull codecs
+NONCOMMERCIAL_PACKAGECONFIGS = " \
+ alsa bzlib drm gpl lzma zlib xcb xv \
+ avdevice avfilter avformat swresample swscale postproc avresample \
+"
+# An ffmpeg feature not in NONCOMMERCIAL_PACKAGECONFIGS should be explicitly whitelisted.
+# See https://ffmpeg.org/legal.html
+LICENSE_FLAGS = "${@' '.join('commercial_' + cfg \
+                             for cfg in '${PACKAGECONFIG}'.split() \
+                             if cfg not in '${NONCOMMERCIAL_PACKAGECONFIGS}'.split())}"
 
 LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
                     file://COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
--

2.30.2

Signature · 2 lines
Yann Dirson <[email protected]>
Blade / Shadow -- http://shadow.tech

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw
Quoted 26 lines · Yann Dirson via lists.openembedded.org

Hi Alex,

Quoted 2 lines · Alexander Kanavin

Is it possible to further split the NONCOMMERCIAL_PACKAGECONFIGS into ones that are enabled and disabled, and use the former in PACKAGECONFIG itself?

You mean something like this ?

# PACKAGECONFIG features that do not pull codecs NONCOMMERCIAL_DEFAULT_PACKAGECONFIGS = " \
avdevice avfilter avformat swresample swscale postproc avresample \
alsa bzlib drm gpl lzma pic pthreads shared zlib \
${@bb.utils.contains('AVAILTUNES', 'mips32r2', 'mips32r2', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xv xcb', '', d)} \
"
NONCOMMERCIAL_NONDEFAULT_PACKAGECONFIGS = " \
altivec bzlib gsm jack openssl sdl2 \
"

PACKAGECONFIG ??= "avcodec theora \
                   ${NONCOMMERCIAL_DEFAULT_PACKAGECONFIGS}"

I admit I'm not completely sure about every feature's status.

Quoted 9 lines

I tend to think that if ffmpeg relies on a lib providing an implementation, and there
are patent-related risks, it should that lib setting a LICENSE_FLAG. Eg. x264 and others
already sets the "commercial" flag, so I'm tempted to not add a duplicate flag in
ffmpeg (in the same spirit as my patches against gst-libav and mpv). Would it be
good enough ?

On second thought, it appears the only PACKAGECONFIG feature bringing codecs and not backed by a lib is just "avcodec".

Thus we could probably just use:

LICENSE_FLAGS = "${@bb.utils.contains('PACKAGECONFIG', 'avcodec', 'commercial', '', d)}"

We would possibly not even need to set EXCLUDE_FROM_WORLD on this one, since the default PACKAGECONFIG would still set the "commercial" flag, right ?

Quoted 68 lines
Quoted 52 lines

Alex

Quoted 46 lines · Yann Dirson

From: Yann Dirson <[email protected]>

The rationale here is that if the user can only whitelist "commercial" to use any part of ffmpeg, even it the list of features is carefully reviewed when switching the whitelisting on, there was nothing to guard from inadvertently activating a new feature that would not have been reviewed.

This patch adds one LICENSE_FLAGS value for each feature, except for those that bring no codec, trying to be on the same level of legal safety - but then I may miss something.

I tried to leave out of the safe NONCOMMERCIAL_PACKAGECONFIGS list anything that brings a codec, notably libavcodec. I also did not look at non-default features yet.

There may still be a problem if any feature in ffmpeg gets activated by default upstream and not registed as a PACKAGECONFIG feature. At least any of those that depend on another lib would not be enabled, that could be seen as a sufficient safeguard.

---
 meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb +11 -1
index 08be38ca50..3a36c95151 100644
@@ -16,7 +16,17 @@ LICENSE_libavutil = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGP
 LICENSE_libpostproc = "GPLv2+"
 LICENSE_libswresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
 LICENSE_libswscale = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
-LICENSE_FLAGS = "commercial"
+
+# PACKAGECONFIG features that do not pull codecs
+NONCOMMERCIAL_PACKAGECONFIGS = " \
+ alsa bzlib drm gpl lzma zlib xcb xv \
+ avdevice avfilter avformat swresample swscale postproc avresample \
+"
+# An ffmpeg feature not in NONCOMMERCIAL_PACKAGECONFIGS should be explicitly whitelisted.
+# See https://ffmpeg.org/legal.html
+LICENSE_FLAGS = "${@' '.join('commercial_' + cfg \
+                             for cfg in '${PACKAGECONFIG}'.split() \
+                             if cfg not in '${NONCOMMERCIAL_PACKAGECONFIGS}'.split())}"
 
Quoted 8 lines
Quoted 8 lines
meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb +0 -1
 LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
                     file://COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
--

2.30.2

--
Yann Dirson <[email protected]>
Blade / Shadow -- http://shadow.tech

Signature · 2 lines
Yann Dirson <[email protected]>
Blade / Shadow -- http://shadow.tech