Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/4] fftools/ffmpeg_enc: strip DOVI config record for AV1
@ 2024-03-19 19:16 Niklas Haas
  2024-03-19 19:16 ` [FFmpeg-devel] [PATCH 2/4] avcodec/dovi_rpu: implement T.35 payload synthesis Niklas Haas
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Niklas Haas @ 2024-03-19 19:16 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Niklas Haas

From: Niklas Haas <git@haasn.dev>

AV1 streams don't use configuration records, so delete them when
encoding to AV1. Ideally this would be, as the comment suggests, handled
at the frame-level (and stripped by the av1 encoder), but given the
status quo of copying the packet-level data here directly, we should
definitely make an effort to strip it.
---
 fftools/ffmpeg_enc.c | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c
index c9a12af1393..0c21acfafc6 100644
--- a/fftools/ffmpeg_enc.c
+++ b/fftools/ffmpeg_enc.c
@@ -354,17 +354,20 @@ int enc_open(void *opaque, const AVFrame *frame)
      */
     if (ist) {
         for (int i = 0; i < ist->st->codecpar->nb_coded_side_data; i++) {
-            AVPacketSideData *sd_src = &ist->st->codecpar->coded_side_data[i];
-            if (sd_src->type != AV_PKT_DATA_CPB_PROPERTIES) {
-                AVPacketSideData *sd_dst = av_packet_side_data_new(&ost->par_in->coded_side_data,
-                                                                   &ost->par_in->nb_coded_side_data,
-                                                                   sd_src->type, sd_src->size, 0);
-                if (!sd_dst)
-                    return AVERROR(ENOMEM);
-                memcpy(sd_dst->data, sd_src->data, sd_src->size);
-                if (ist->autorotate && sd_src->type == AV_PKT_DATA_DISPLAYMATRIX)
-                    av_display_rotation_set((int32_t *)sd_dst->data, 0);
-            }
+            AVPacketSideData *sd_src, *sd_dst;
+            sd_src = &ist->st->codecpar->coded_side_data[i];
+            if (sd_src->type == AV_PKT_DATA_CPB_PROPERTIES)
+                continue;
+            if (sd_src->type == AV_PKT_DATA_DOVI_CONF && enc->id == AV_CODEC_ID_AV1)
+                continue; /* AV1 doesn't use DOVI configuration records */
+            sd_dst = av_packet_side_data_new(&ost->par_in->coded_side_data,
+                                             &ost->par_in->nb_coded_side_data,
+                                             sd_src->type, sd_src->size, 0);
+            if (!sd_dst)
+                return AVERROR(ENOMEM);
+            memcpy(sd_dst->data, sd_src->data, sd_src->size);
+            if (ist->autorotate && sd_src->type == AV_PKT_DATA_DISPLAYMATRIX)
+                av_display_rotation_set((int32_t *)sd_dst->data, 0);
         }
     }
 
-- 
2.44.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2024-03-23 17:45 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-19 19:16 [FFmpeg-devel] [PATCH 1/4] fftools/ffmpeg_enc: strip DOVI config record for AV1 Niklas Haas
2024-03-19 19:16 ` [FFmpeg-devel] [PATCH 2/4] avcodec/dovi_rpu: implement T.35 payload synthesis Niklas Haas
2024-03-19 19:16 ` [FFmpeg-devel] [PATCH 3/4] avcodec/libaomenc: encode dovi RPUs as T.35 metadata Niklas Haas
2024-03-19 19:16 ` [FFmpeg-devel] [PATCH 4/4] avcodec/libx265: encode dovi RPUs Niklas Haas
2024-03-19 21:39   ` Derek Buitenhuis
     [not found]     ` <9183F034-A7F5-4683-A932-273E15B9886C@cosmin.at>
2024-03-19 21:59       ` Cosmin Stejerean via ffmpeg-devel
2024-03-19 23:04         ` Niklas Haas
2024-03-19 23:19           ` Vittorio Giovara
2024-03-21 12:09             ` Niklas Haas
2024-03-20 19:30   ` Michael Niedermayer
2024-03-20 21:22     ` Jan Ekström
2024-03-21 12:02       ` Niklas Haas
2024-03-21 10:16 ` [FFmpeg-devel] [PATCH 1/4] fftools/ffmpeg_enc: strip DOVI config record for AV1 Anton Khirnov
2024-03-21 12:11   ` Niklas Haas
2024-03-22  9:41     ` Anton Khirnov
2024-03-22 13:08       ` Niklas Haas
2024-03-22 17:04         ` Niklas Haas
2024-03-23 17:45 ` Niklas Haas

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git