* [FFmpeg-devel] [PATCH] fftools/ffmpeg_mux_init: do not write encoder metadata for ogg files with bitexact
@ 2025-11-15 22:32 Tolga Celebi via ffmpeg-devel
2025-11-16 6:54 ` [FFmpeg-devel] " Gyan Doshi via ffmpeg-devel
0 siblings, 1 reply; 2+ messages in thread
From: Tolga Celebi via ffmpeg-devel @ 2025-11-15 22:32 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: tolgakaan12, Tolga Celebi
From: tolgakaan12 <70590077+tolgakaan12@users.noreply.github.com>
The set_encoder_id function in fftools/ffmpeg_mux_init was writing a shortened encoder tag even when -bitexact flag was set, instead of omitting it entirely like other formats (flac, mp3, wav) do. This patch makes the function return early if bitexact flag is set, ensuring no encoder metadata is written.
Fixes ticket #11656.
---
fftools/ffmpeg_mux_init.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
index bcbbee9126..3d13c9c257 100644
--- a/fftools/ffmpeg_mux_init.c
+++ b/fftools/ffmpeg_mux_init.c
@@ -1167,15 +1167,15 @@ static int set_encoder_id(OutputStream *ost, const AVCodec *codec)
uint8_t *encoder_string;
int encoder_string_len;
+ if (ost->file->bitexact || ost->bitexact)
+ return 0;
+
encoder_string_len = sizeof(LIBAVCODEC_IDENT) + strlen(cname) + 2;
encoder_string = av_mallocz(encoder_string_len);
if (!encoder_string)
return AVERROR(ENOMEM);
- if (!ost->file->bitexact && !ost->bitexact)
- av_strlcpy(encoder_string, LIBAVCODEC_IDENT " ", encoder_string_len);
- else
- av_strlcpy(encoder_string, "Lavc ", encoder_string_len);
+ av_strlcpy(encoder_string, LIBAVCODEC_IDENT " ", encoder_string_len);
av_strlcat(encoder_string, cname, encoder_string_len);
av_dict_set(&ost->st->metadata, "encoder", encoder_string,
AV_DICT_DONT_STRDUP_VAL | AV_DICT_DONT_OVERWRITE);
--
2.50.1 (Apple Git-155)
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
^ permalink raw reply [flat|nested] 2+ messages in thread
* [FFmpeg-devel] Re: [PATCH] fftools/ffmpeg_mux_init: do not write encoder metadata for ogg files with bitexact
2025-11-15 22:32 [FFmpeg-devel] [PATCH] fftools/ffmpeg_mux_init: do not write encoder metadata for ogg files with bitexact Tolga Celebi via ffmpeg-devel
@ 2025-11-16 6:54 ` Gyan Doshi via ffmpeg-devel
0 siblings, 0 replies; 2+ messages in thread
From: Gyan Doshi via ffmpeg-devel @ 2025-11-16 6:54 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Gyan Doshi
On 2025-11-16 04:02 am, Tolga Celebi via ffmpeg-devel wrote:
> From: tolgakaan12 <70590077+tolgakaan12@users.noreply.github.com>
>
> The set_encoder_id function in fftools/ffmpeg_mux_init was writing a shortened encoder tag even when -bitexact flag was set, instead of omitting it entirely like other formats (flac, mp3, wav) do. This patch makes the function return early if bitexact flag is set, ensuring no encoder metadata is written.
>
> Fixes ticket #11656.
NAK. Bitexact does not mean lack of encoder metadata - it means metadata
that is invariant across versions. Most formats will still write some
encoder metadata.
This patch fails close to 200 of our automated tests - see
https://patchwork.ffmpeg.org/project/ffmpeg/patch/20251115223242.90376-1-celebitolgakaan@gmail.com/
To omit this for a particular muxer, modify that muxer by checking for
the flag AVFMT_FLAG_BITEXACT. Look at libavformat/wavenc.c for reference.
Regards,
Gyan
> ---
> fftools/ffmpeg_mux_init.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
> index bcbbee9126..3d13c9c257 100644
> --- a/fftools/ffmpeg_mux_init.c
> +++ b/fftools/ffmpeg_mux_init.c
> @@ -1167,15 +1167,15 @@ static int set_encoder_id(OutputStream *ost, const AVCodec *codec)
> uint8_t *encoder_string;
> int encoder_string_len;
>
> + if (ost->file->bitexact || ost->bitexact)
> + return 0;
> +
> encoder_string_len = sizeof(LIBAVCODEC_IDENT) + strlen(cname) + 2;
> encoder_string = av_mallocz(encoder_string_len);
> if (!encoder_string)
> return AVERROR(ENOMEM);
>
> - if (!ost->file->bitexact && !ost->bitexact)
> - av_strlcpy(encoder_string, LIBAVCODEC_IDENT " ", encoder_string_len);
> - else
> - av_strlcpy(encoder_string, "Lavc ", encoder_string_len);
> + av_strlcpy(encoder_string, LIBAVCODEC_IDENT " ", encoder_string_len);
> av_strlcat(encoder_string, cname, encoder_string_len);
> av_dict_set(&ost->st->metadata, "encoder", encoder_string,
> AV_DICT_DONT_STRDUP_VAL | AV_DICT_DONT_OVERWRITE);
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-16 6:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-15 22:32 [FFmpeg-devel] [PATCH] fftools/ffmpeg_mux_init: do not write encoder metadata for ogg files with bitexact Tolga Celebi via ffmpeg-devel
2025-11-16 6:54 ` [FFmpeg-devel] " Gyan Doshi via ffmpeg-devel
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