Bug 261752 - multimedia/ffmpeg: disable THEORA/XVID, enable WEBP
Summary: multimedia/ffmpeg: disable THEORA/XVID, enable WEBP
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Thomas Zander
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2022-02-06 17:25 UTC by Jan Beich
Modified: 2022-08-06 12:10 UTC (History)
4 users (show)

See Also:
riggs: maintainer-feedback+


Attachments
v1 (1.16 KB, patch)
2022-02-06 17:25 UTC, Jan Beich
no flags Details | Diff
v1 (apply via "git am") (1.16 KB, patch)
2022-02-06 17:51 UTC, Jan Beich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2022-02-06 17:25:35 UTC
Created attachment 231581 [details]
v1

From a quick look at the default options it seems we enable some encoders for codecs that have been obsoleted several times e.g.,

- Theora -> VP8 -> VP9 -> AV1 -> AV2 (experimental)
- MPEG-4 ASP -> H.264/AVC -> H.265/HEVC -> H.266/VVC vs. EVC
- JPEG + PNG + GIF -> WEBP -> AVIF vs. JXL
Comment 1 Jan Beich freebsd_committer freebsd_triage 2022-02-06 17:51:47 UTC
Created attachment 231583 [details]
v1 (apply via "git am")
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2022-02-06 23:17:15 UTC
What is the context of 'deprecation' here? Is it an upstream designation for that codecs support in ffmpeg, that they should not be used or included in the context of an ffmpeg build, that the 'later' codecs listed in comment 0 also support the original/older formats making the older codec builds unnecessary, or something else? 

All else being equal, if the older formats are not supported in the newer codecs/modules, does retaining the ability for users/players/dependent software to play and render these formats still remain useful?
Comment 3 Daniel Engberg freebsd_committer freebsd_triage 2022-02-07 17:15:06 UTC
Looks good me, while there isn't a native encoder for Theora there is one for MPEG-4 so the "loss" of XviD shouldn't be of much impact. I really can't see of a use-case that would justify Theora these days when you have a lot of alternatives.
Comment 4 Benjamin Takacs 2022-02-08 10:12:16 UTC
(In reply to Daniel Engberg from comment #3)
The question if you are still able to *decode* your files remains.

While there might be no reason to encode new stuff using these codecs, if one has or gets some file one hasn't much influence which codec was used to encode it.
Comment 5 Daniel Engberg freebsd_committer freebsd_triage 2022-02-08 10:21:41 UTC
Both are encoding only libraries according to ffmpeg's documentation and as far as I can tell.
Comment 6 Jan Beich freebsd_committer freebsd_triage 2022-02-08 11:52:04 UTC
FFmpeg prefers its own more efficient decoders for almost everything e.g.,
- Theora decoding is provided by libavcodec/vp3.c
- Xvid decoding is provided by libavcodec/mpeg4videodec.c

$ ffmpeg -hide_banner -help decoder=theora
Decoder theora [Theora]:
    General capabilities: horizband dr1 threads
    Threading capabilities: frame

$ ffmpeg -hide_banner -help decoder=mpeg4
Decoder mpeg4 [MPEG-4 part 2]:
    General capabilities: horizband dr1 delay threads
    Threading capabilities: frame
    Supported hardware devices: vaapi
    Supported pixel formats: vaapi yuv420p
MPEG4 Video Decoder AVOptions:

Also, external libraries are disabled by default upstream:

$ ./configure --help
[...]
  --enable-libtheora       enable Theora encoding via libtheora [no]
  --enable-libxvid         enable Xvid encoding via xvidcore,
                           native MPEG-4/Xvid encoder exists [no]
Comment 7 Jamie Landeg-Jones 2022-02-08 12:34:45 UTC
As an aside, I checked my config, and I had both enabled. I have never had any desire to encode in either format, but looking at the dialog4ports screen:

[x] VORBIS            Ogg Vorbis audio codec support                                                                                                                                                   [x] XVID              Xvid MPEG-4 video codec support

I erroneously thought they were required for decoding, too.

Perhaps change this (and others) to say "encoding support" ?

Maybe for these 2, also add "*deprecated*" at the end?
Comment 8 Daniel Engberg freebsd_committer freebsd_triage 2022-02-09 22:33:40 UTC
Theora != Vorbis ;-)
What we usually do is deprecating the libraries and after exp date they get removed (along with all references in tree).
Comment 9 Jamie Landeg-Jones 2022-02-09 23:44:48 UTC
(In reply to Daniel Engberg from comment #8)

Ooops! I actually checked theora on my side of things, but then messed up the copy/paste edit! I'm always mixing those 2 up! *blush*

Thanks for the explanation, but on a more general point, could codecs only required for encoding be marked as such in the dialog menu?

Cheers!
Comment 10 Daniel Engberg freebsd_committer freebsd_triage 2022-03-08 10:12:28 UTC
This will also probably break multimedia/ffmpeg2theora which should be sunset by now anyway
Comment 11 Daniel Engberg freebsd_committer freebsd_triage 2022-05-10 11:29:54 UTC
ffmpeg2theora is now marked as deprecated as of https://cgit.freebsd.org/ports/commit/?id=2214ad3c409470eceeec0f507c7bb8c7dbfeab23
Comment 12 commit-hook freebsd_committer freebsd_triage 2022-08-06 12:03:20 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2bc24ba7f2d798e2389bfaa2a5c1d27fd9724f0c

commit 2bc24ba7f2d798e2389bfaa2a5c1d27fd9724f0c
Author:     Thomas Zander <riggs@FreeBSD.org>
AuthorDate: 2022-08-06 11:40:24 +0000
Commit:     Thomas Zander <riggs@FreeBSD.org>
CommitDate: 2022-08-06 12:01:50 +0000

    multimedia/ffmpeg: Update default OPTIONS for THEORA, XVID, WEBP

    Details:
    - Remove THEORA and XVID from default OPTIONS:
      Both formats can be decoded using ffmpeg's internal decoders. For
      encoding, both formats are superseded for almost all practical
      purposes by H264,H265,AV1,etc.
    - Modify _DESC for THEORA and XVID to make it more clear that this is
      only required if someone wants to use those libs for encoding.
    - Add WEBP (ubiquitous image format) to default OPTIONS.

    PR:             261752
    Reported by:    jbeich

 multimedia/ffmpeg/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)