From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 363BC4D2C2 for ; Fri, 16 May 2025 14:52:30 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 59E5568CEEF; Fri, 16 May 2025 17:52:26 +0300 (EEST) Received: from btbn.de (btbn.de [144.76.60.213]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 0634968CEE1 for ; Fri, 16 May 2025 17:52:20 +0300 (EEST) Received: from [authenticated] by btbn.de (Postfix) with ESMTPSA id 72C2D2819107D for ; Fri, 16 May 2025 16:52:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothenpieler.org; s=mail; t=1747407139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xBFoQaMtacTVb3emh0+fVEsAgJXw1DfefR0n2zWymGI=; b=eLBXEwlmIoXrBNhPpvF1HW5E6dR631UyGHE0VbuoAn8+3ShREMtC7UykYbIv1vOrJJe+wX A5Z3UMotcfHCXyqCHaaqj0ZxHjHbfFo4yruKoDlBQEUIAUHkFru91+CZub5fX3jOKU68RJ HuS9tbxqVnjsEU7wZDS+9wI+v/5FY8C9TWWoQ4AkPcj/m5+pnUplUR+vi8F4yUsFv2GxAP MZ742QTVQMtqeT/HCQb/Ji2jV2hni+lfpXRFK4QAQW9PeSPrHY5A0gcp4wztmz2rPVil1X 7hG+ibP6RUZsrJrVoDt3JEZu/xqWcxr3YOH0uu+pWiH5kGgU2bHT8m0dMUX9/Q== Message-ID: Date: Fri, 16 May 2025 16:52:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: Content-Language: en-US, de-DE From: Timo Rothenpieler In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH] avformat/flvenc: Specify codec tag with MKTAG X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 16/05/2025 16:24, Zhao Zhili wrote: > From: Zhao Zhili > > 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. > --- > libavformat/flvenc.c | 26 +++++++++++++++++--------- > 1 file changed, 17 insertions(+), 9 deletions(-) > > diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c > index f026f0e53b..e92828b197 100644 > --- a/libavformat/flvenc.c > +++ b/libavformat/flvenc.c > @@ -52,9 +52,9 @@ static const AVCodecTag flv_video_codec_ids[] = { > { AV_CODEC_ID_VP6, FLV_CODECID_VP6 }, > { AV_CODEC_ID_VP6A, FLV_CODECID_VP6A }, > { AV_CODEC_ID_H264, FLV_CODECID_H264 }, > - { AV_CODEC_ID_HEVC, MKBETAG('h', 'v', 'c', '1') }, > - { AV_CODEC_ID_AV1, MKBETAG('a', 'v', '0', '1') }, > - { AV_CODEC_ID_VP9, MKBETAG('v', 'p', '0', '9') }, > + { AV_CODEC_ID_HEVC, MKTAG('h', 'v', 'c', '1') }, > + { AV_CODEC_ID_AV1, MKTAG('a', 'v', '0', '1') }, > + { AV_CODEC_ID_VP9, MKTAG('v', 'p', '0', '9') }, > { AV_CODEC_ID_NONE, 0 } > }; > > @@ -69,10 +69,10 @@ static const AVCodecTag flv_audio_codec_ids[] = { > { AV_CODEC_ID_PCM_MULAW, FLV_CODECID_PCM_MULAW >> FLV_AUDIO_CODECID_OFFSET }, > { AV_CODEC_ID_PCM_ALAW, FLV_CODECID_PCM_ALAW >> FLV_AUDIO_CODECID_OFFSET }, > { AV_CODEC_ID_SPEEX, FLV_CODECID_SPEEX >> FLV_AUDIO_CODECID_OFFSET }, > - { AV_CODEC_ID_OPUS, MKBETAG('O', 'p', 'u', 's') }, > - { AV_CODEC_ID_FLAC, MKBETAG('f', 'L', 'a', 'C') }, > - { AV_CODEC_ID_AC3, MKBETAG('a', 'c', '-', '3') }, > - { AV_CODEC_ID_EAC3, MKBETAG('e', 'c', '-', '3') }, > + { AV_CODEC_ID_OPUS, MKTAG('O', 'p', 'u', 's') }, > + { AV_CODEC_ID_FLAC, MKTAG('f', 'L', 'a', 'C') }, > + { AV_CODEC_ID_AC3, MKTAG('a', 'c', '-', '3') }, > + { AV_CODEC_ID_EAC3, MKTAG('e', 'c', '-', '3') }, > { AV_CODEC_ID_NONE, 0 } > }; > > @@ -348,7 +348,11 @@ static void write_metadata(AVFormatContext *s, unsigned int ts) > } > > put_amf_string(pb, "videocodecid"); > - put_amf_double(pb, flv->video_par->codec_tag); > + uint32_t tag = flv->video_par->codec_tag; > + // check and convert to fourcc > + if (tag & 0xFFFFFF00) > + tag = av_bswap32(tag); > + put_amf_double(pb, tag); Shouldn't this be completely equivalent to having MKBETAG generate it in big-endian order from the get-go? > } > > if (flv->audio_par) { > @@ -365,7 +369,11 @@ static void write_metadata(AVFormatContext *s, unsigned int ts) > put_amf_bool(pb, flv->audio_par->ch_layout.nb_channels == 2); > > put_amf_string(pb, "audiocodecid"); > - put_amf_double(pb, flv->audio_par->codec_tag); > + uint32_t tag = flv->audio_par->codec_tag; > + // check and convert to fourcc > + if (tag & 0xFFFFFF00) > + tag = av_bswap32(tag); > + put_amf_double(pb, tag); > } > > if (flv->data_par) { _______________________________________________ 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".