On 4/10/2026 6:08 AM, Rys, Grzegorz wrote:
I also added support for MPEGTS as one of customer requested that.
Updated patch:
 From 29f918767fac1974d290a36a1c03dd9ed9fc111e Mon Sep 17 00:00:00 2001
From: Grzegorz Rys <[email protected]>
Date: Mon, 30 Oct 2023 06:49:02 +0100
Subject: [PATCH 1/3] Allow JPEG XS to be stored in mp4, mkv and mpegts
  containers

---
  libavformat/isom.c      | 1 +
  libavformat/isom_tags.c | 1 +
  libavformat/movenc.c    | 1 +
  libavformat/mpegtsenc.c | 3 +++
  4 files changed, 6 insertions(+)

diff --git a/libavformat/isom.c b/libavformat/isom.c
index 1a2b3c4d5e..5f6e7f8e9d 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -54,6 +54,7 @@ const AVCodecTag ff_mp4_obj_type[] = {
      { AV_CODEC_ID_MP3         , 0x6B }, /* 11172-3 */
      { AV_CODEC_ID_MJPEG       , 0x6C }, /* 10918-1 */
      { AV_CODEC_ID_PNG         , 0x6D },
      { AV_CODEC_ID_JPEG2000    , 0x6E }, /* 15444-1 */
+    { AV_CODEC_ID_JPEGXS      , 0x6F }, /* ISO/IEC 21122-3 */
      { AV_CODEC_ID_VC1         , 0xA3 },
      { AV_CODEC_ID_DIRAC       , 0xA4 },

diff --git a/libavformat/isom_tags.c b/libavformat/isom_tags.c
index 1cd655b06c..6f193196ca 100644
--- a/libavformat/isom_tags.c
+++ b/libavformat/isom_tags.c
@@ -213,6 +213,7 @@ const AVCodecTag ff_codec_movvideo_tags[] = {
      { AV_CODEC_ID_MPEG2VIDEO, MKTAG('m', 'p', '2', 'v') }, /* FCP5 */

      { AV_CODEC_ID_JPEG2000, MKTAG('m', 'j', 'p', '2') }, /* JPEG 2000 
produced by FCP */
+    { AV_CODEC_ID_JPEGXS,   MKTAG('j', 'x', 's', ' ') }, /* JPEGXS */

      { AV_CODEC_ID_TARGA, MKTAG('t', 'g', 'a', ' ') }, /* Truevision Targa */
      { AV_CODEC_ID_TIFF,  MKTAG('t', 'i', 'f', 'f') }, /* TIFF embedded in MOV 
*/

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 8f9e7d5c6b..abcdef123456 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -8897,6 +8897,7 @@ static const AVCodecTag codec_mp4_tags[] = {
      { AV_CODEC_ID_PNG,             MKTAG('m', 'p', '4', 'v') },
      { AV_CODEC_ID_JPEG2000,        MKTAG('m', 'p', '4', 'v') },
+    { AV_CODEC_ID_JPEGXS,          MKTAG('j', 'x', 's', ' ') },
      { AV_CODEC_ID_VC1,             MKTAG('v', 'c', '-', '1') },
      { AV_CODEC_ID_DIRAC,           MKTAG('d', 'r', 'a', 'c') },
      { AV_CODEC_ID_TSCC2,           MKTAG('m', 'p', '4', 'v') },
      { AV_CODEC_ID_VP9,             MKTAG('v', 'p', '0', '9') },

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -387,6 +387,9 @@ static int get_dvb_stream_type(AVFormatContext *s, AVStream 
*st)
      case AV_CODEC_ID_DIRAC:
          stream_type = STREAM_TYPE_VIDEO_DIRAC;
          break;
+    case AV_CODEC_ID_JPEGXS:
+        stream_type = STREAM_TYPE_VIDEO_JPEGXS;
+        break;
      case AV_CODEC_ID_VC1:
          stream_type = STREAM_TYPE_VIDEO_VC1;
          break;

No, you're not writing the JXS_VIDEO_DESCRIPTOR. libavformat must not write incomplete and non spec complaint files.

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to