[FFmpeg-devel] [PATCH v4 1/2] avcodec/libjxl: add animated JPEG XL encoder

Leo Izen leo.izen at gmail.com
Wed Dec 25 01:28:14 EET 2024


On 12/24/24 5:23 PM, Marth64 wrote:
> Hi Leo,
> 
> Code in v4 is clean and LGTM.
> Also, I tested today successfully and got a good visual result when
> playing back (though I had to use data muxer).
> ```
> ffmpeg -i pizza.mkv -map 0:v -c:v libjxl_anim -f data test.jxl
> ```
> 
> Sorry for the back and forth on this last bit, but in libavcodec/version.c,
> can anyone chime in on what is the etiquette here when adding a new Codec ID?
> I think that the assert in avcodec_version() needs to be updated,
> but should the minor version be updated too?
> 
> Or are these changed at release time?
> Could this also be accomplished without a new codec ID (eg. treated
> like MJPEG/JPEG)?

In theory, it could be, but without a separate codec ID there's risk 
that clients requesting an encoder for AV_CODEC_ID_JPEGXL will get the 
animated encoder without intending to. mpv runs into this issue with 
webp screenshots, it has to explicitly request the libwebp encoder over 
the libwebp_anim encoder, and I don't want to break clients that don't 
expect something like this.

Also, you can use image2pipe, you don't need to use the data muxer.

I'm pretty sure new encoders/decoders/codecs require a minor version 
bump. I'm not so sure about the assert. See: 
c3083b3266cf01fdc43e5d03e27bea35d7c1faae which is the most recent codec 
added, and it didn't change the assert. Although that may have been a 
mistake as well.

- Leo Izen (Traneptora)



More information about the ffmpeg-devel mailing list