@@ -506,6 +506,7 @@ extern const AVInputFormat ff_image_gif_pipe_demuxer;
extern const AVInputFormat ff_image_j2k_pipe_demuxer;
extern const AVInputFormat ff_image_jpeg_pipe_demuxer;
extern const AVInputFormat ff_image_jpegls_pipe_demuxer;
+extern const AVInputFormat ff_image_jpegxl_pipe_demuxer;
extern const AVInputFormat ff_image_pam_pipe_demuxer;
extern const AVInputFormat ff_image_pbm_pipe_demuxer;
extern const AVInputFormat ff_image_pcx_pipe_demuxer;
@@ -87,6 +87,7 @@ const IdStrMap ff_img_tags[] = {
{ AV_CODEC_ID_GEM, "img" },
{ AV_CODEC_ID_GEM, "ximg" },
{ AV_CODEC_ID_GEM, "timg" },
+ { AV_CODEC_ID_JPEGXL, "jxl" },
{ AV_CODEC_ID_NONE, NULL }
};
@@ -30,6 +30,7 @@
#include "libavutil/parseutils.h"
#include "libavutil/intreadwrite.h"
#include "libavcodec/gif.h"
+#include "libavcodec/jpegxl.h"
#include "avformat.h"
#include "avio_internal.h"
#include "internal.h"
@@ -834,6 +835,23 @@ static int jpegls_probe(const AVProbeData *p)
return 0;
}
+static int jpegxl_probe(const AVProbeData *p)
+{
+ const uint8_t *b = p->buf;
+
+ /* ISOBMFF-based container */
+ /* 0x4a584c20 == "JXL " */
+ if (AV_RL64(b) == FF_JPEGXL_CONTAINER_SIGNATURE_LE)
+ return AVPROBE_SCORE_EXTENSION + 1;
+ /* Raw codestreams all start with 0xff0a */
+ if (AV_RL16(b) != FF_JPEGXL_CODESTREAM_SIGNATURE_LE)
+ return 0;
+ if (avpriv_jpegxl_verify_codestream_header(NULL, p->buf, p->buf_size, 5) == 0)
+ return AVPROBE_SCORE_MAX - 2;
+ else
+ return 0;
+}
+
static int pcx_probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;
@@ -1153,6 +1171,7 @@ IMAGEAUTO_DEMUXER(gif, AV_CODEC_ID_GIF)
IMAGEAUTO_DEMUXER(j2k, AV_CODEC_ID_JPEG2000)
IMAGEAUTO_DEMUXER(jpeg, AV_CODEC_ID_MJPEG)
IMAGEAUTO_DEMUXER(jpegls, AV_CODEC_ID_JPEGLS)
+IMAGEAUTO_DEMUXER(jpegxl, AV_CODEC_ID_JPEGXL)
IMAGEAUTO_DEMUXER(pam, AV_CODEC_ID_PAM)
IMAGEAUTO_DEMUXER(pbm, AV_CODEC_ID_PBM)
IMAGEAUTO_DEMUXER(pcx, AV_CODEC_ID_PCX)
@@ -261,9 +261,9 @@ static const AVClass img2mux_class = {
const AVOutputFormat ff_image2_muxer = {
.name = "image2",
.long_name = NULL_IF_CONFIG_SMALL("image2 sequence"),
- .extensions = "bmp,dpx,exr,jls,jpeg,jpg,ljpg,pam,pbm,pcx,pfm,pgm,pgmyuv,png,"
- "ppm,sgi,tga,tif,tiff,jp2,j2c,j2k,xwd,sun,ras,rs,im1,im8,im24,"
- "sunras,xbm,xface,pix,y",
+ .extensions = "bmp,dpx,exr,jls,jpeg,jpg,jxl,ljpg,pam,pbm,pcx,pfm,pgm,pgmyuv,"
+ "png,ppm,sgi,tga,tif,tiff,jp2,j2c,j2k,xwd,sun,ras,rs,im1,im8,"
+ "im24,sunras,xbm,xface,pix,y",
.priv_data_size = sizeof(VideoMuxData),
.video_codec = AV_CODEC_ID_MJPEG,
.write_header = write_header,
@@ -7463,6 +7463,7 @@ static int mov_probe(const AVProbeData *p)
if (tag == MKTAG('f','t','y','p') &&
( AV_RL32(p->buf + offset + 8) == MKTAG('j','p','2',' ')
|| AV_RL32(p->buf + offset + 8) == MKTAG('j','p','x',' ')
+ || AV_RL32(p->buf + offset + 8) == MKTAG('j','x','l',' ')
)) {
score = FFMAX(score, 5);
} else {
@@ -32,7 +32,7 @@
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
// Also please add any ticket numbers that you believe might be affected here
#define LIBAVFORMAT_VERSION_MAJOR 59
-#define LIBAVFORMAT_VERSION_MINOR 10
+#define LIBAVFORMAT_VERSION_MINOR 11
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \