Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Zhao Zhili <quinkblack-at-foxmail.com@ffmpeg.org>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] avformat/flvenc: Specify codec tag with MKTAG
Date: Sat, 17 May 2025 01:18:46 +0800
Message-ID: <tencent_3E1094A6DE27CAEAB4D3041C650B8FA63B06@qq.com> (raw)
In-Reply-To: <tencent_5F0F9AA49F5BAB184EF570C12DB39A2B4008@qq.com>



> On May 17, 2025, at 01:10, Zhao Zhili <quinkblack-at-foxmail.com@ffmpeg.org> wrote:
> 
> 
> 
>> On May 17, 2025, at 00:27, Timo Rothenpieler <timo@rothenpieler.org> wrote:
>> 
>> On 16.05.2025 17:59, Zhao Zhili wrote:
>>>> On May 16, 2025, at 22:52, Timo Rothenpieler <timo@rothenpieler.org> wrote:
>>>> 
>>>> On 16/05/2025 16:24, Zhao Zhili wrote:
>>>>> From: Zhao Zhili <zhilizhao@tencent.com <mailto:zhilizhao@tencent.com>>
>>>>> ffmpeg -i input.mp4 -c copy -tag:v av01 output.flv
>>>>> [flv @ 0x143204080] Tag av01 incompatible with output codec id '225' (10va)
>>>> 
>>>> I don't quite understand what causes this.
>>>> Is this an issue when running on big endian architectures?
>>>> I'm pretty sure I tested all combinations of codecs with muxing and demuxing, and never ran into that error.
>>> The key point is when specify tag via command line, e.g., -tag:v av01, it’s
>>> passed to AVCodecParameters codec_tag in little endian.
>>> You didn’t see the error because without specify the tag explicitly, codec_tag is copied
>>> from AVOutputFormat codec_tag to AVCodecParameters codec_tag, so they are
>>> the same.
>>> Another example is codec_mp4_tags.
>> 
>> This still irks me as wrong.
>> There is _a lot_ of places all over flvenv.c, in all kinds of functions, that hard-depend on the values in par->codec_tag being from the _codec_ids tables at the top of the file.
>> Like, they contain flv specific audio and video codec IDs for the pre-ext-flv codecs, those would all also break.
>> 
>> So there seems to be a deeper issue there if those values can be overridden from the commandline. The encoder clearly does not expect that.
>> 
>> Looking at the code this error comes from:
>> https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/mux.c#L314
>> 
>> It looks to to me like it's working exactly as intended and required by flvenc, protecting it from invalid tags.
>> 
>> So, when the user provides a custom tag that is invalid, isn't that kinda on the user?
>> The check you're running into does what it's supposed to:
>> It detects that the provided tag is invalid for this codec in this container.
>> 
>> Why do you want to override it anyway? There is only exactly one valid tag for each codec.
> 
> A user shows the error message to me. Because he know there are -tag option for mp4, and
> enhanced-rtmp use fourcc for extended codecs, so he thought it should work.
> 
> The -tag:v av01 is redundant, it should be a NOP, not trigger error. The strings “av01”
> is the right order of fourcc in spec. The endian issue should be limited to the internal.
> Current error message is confusing, because it shows 10va instead of av01.
> 
>> _______________________________________________
>> 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".
> 
> _______________________________________________
> 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".

_______________________________________________
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".

  reply	other threads:[~2025-05-16 17:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-16 14:24 Zhao Zhili
2025-05-16 14:52 ` Timo Rothenpieler
2025-05-16 15:59   ` Zhao Zhili
2025-05-16 16:27     ` Timo Rothenpieler
2025-05-16 17:10       ` Zhao Zhili
2025-05-16 17:18         ` Zhao Zhili [this message]
2025-05-16 17:24         ` Zhao Zhili
2025-05-16 17:39           ` Timo Rothenpieler
2025-05-17  4:35             ` Zhao Zhili
2025-05-17 11:14               ` Timo Rothenpieler
2025-05-17 14:05                 ` Zhao Zhili
2025-05-17 15:43                   ` Timo Rothenpieler
2025-05-17 23:38                   ` Michael Niedermayer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_3E1094A6DE27CAEAB4D3041C650B8FA63B06@qq.com \
    --to=quinkblack-at-foxmail.com@ffmpeg.org \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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