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 E97B34DFF8 for ; Fri, 9 Jan 2026 22:16:52 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'NizxQ5+dukMpvozvFanHLu81Nnc/mGbHwsDwHGpdnuI=', expected b'sFZFV8G0nGWtd8OhB79MYiMGTP+1Qmqj2c+Si1+b+0w=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1767996993; h=mime-version : to : date : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=NizxQ5+dukMpvozvFanHLu81Nnc/mGbHwsDwHGpdnuI=; b=Mn73MKnuxfVwbZNBqJ3HrpDXix96ETM0ajNaKEhOUMW5gKP6ITDOvvgR12SRO/XbURqFb yLQafxdZJc6Ym6rsnrFP7Jlhl0NfHJg3SVVf/Q2QMv0p7Tt4Uce+nZeOBWq8t7Zne7FSrpk BBJ5T+FikC9mnTYoMbHRkCA9F0B4pCSnDyPEOJ07fFjMKrDVDr3fELwbkuoONawDAiGzaic e2BYFJb3+z33mCkyWPOx/rckRZp2Fy0+HR0wuFt/0foe+jvJOudNGSIvboBd5QadMX2jS1L /1cNxV/5JQ5tD044hePHRfAm+yXXz7UuNcq840UauEWOlDRi+8KFVBPi+wqA== Received: from [172.20.0.4] (unknown [172.20.0.4]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 026A9690DF5; Sat, 10 Jan 2026 00:16:33 +0200 (EET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1767996973; b=V0kjvuDsJvFpuba6IP3uDZIZSjPpwurVqaYMLa6X2uA8iupUzikb48IL7ZsF/xFkk5VqA LmwCHOMCWPxe8TleySSxj5CR03xQE/SHUeD/rqQWChI/gTnnmEauCM4f3uzWqcgsh/cwslh MErYxN+zVy3/daX8NugdrzQ/ZXqIz8302tnBIgb9fRAy/RF0PwY798HUeBbiGqppg+8kHkA EnueDHv2wJ1QYKmDjsOTroxI+STALeDZwkv4W4TPZOfPYKoIDDhEUikpxxydn/GKCtn5ItJ pqK1dyPqelKN7J5XEb43Iz5anO8xdjBPpF6pvtC2O/BKezN068lRdeEIZclg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1767996973; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=asq2g192F+qILUizzjyi8oHcElbaueETaAkOtLv8ntk=; b=B49l2rO/+HJOxK44KVgbJtKhnnnaIC1OInzYXLomcO2ZIyKBemNwJb8MgooRG/Yea/XgB gXoFgyjR99iMPjCZb+tYJ2SFdROjbb9EqrMiAbqPUXnhEPzUXRU267YNomVH/YbYmc7yjy6 cpME2dj6hCDOKhzFhu/yrPC1ALnYMq3qf8D99FrL81p8q7pY4Nzz0/pSEiZ/Jj79F+6EkNf 45pYfs7gKrH4eckZF6Im9xdRFzUj6XPJCb+TzzEsqfZifrrs2YGAOfP75Wf9sITfvF1ws/M eDTD7BT2V75x1utmh9YGpHR90Wbkf5FdtbWzvP4bdWg3KZwA26WJD6SoXC5Q== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=pass header.from=ffmpeg.org policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=ffmpeg.org policy.dmarc=quarantine DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1767996964; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=sFZFV8G0nGWtd8OhB79MYiMGTP+1Qmqj2c+Si1+b+0w=; b=dI6NMb05GRjtKnZxUeexrd3xUOw8yT42RysERayuFybpDrexsVrfrsE3Si2+g7GpLE6C0 ItKisTIH0GGt463BoLGQhanH3t9KbVjioV83ywWJuLHh46+XYwTRID7VVmW5TVzWzvsl6I5 itQqVT6RkAlj6IOENV75U/BULrbvzOZhwxV/IE7fxkysJbDS6yVXDvS9KgyiRKNh/Wt2Q3D QTwbLulR62xkfWQPN5AB68FIxWuHLWI3r/rpNrpKtY4MzuvShfviOzaq4p6winAZg5kM08H t0vN/fXf+G23W/j5mjlF1tfycAjQ+Yy9Mi69kVBe7U6E6Qz6ESGpqUeVHJhQ== Received: from f7c34508609e (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id AF3466909B1 for ; Sat, 10 Jan 2026 00:16:04 +0200 (EET) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Fri, 09 Jan 2026 22:16:04 -0000 Message-ID: <176799696481.25.13152280689310897210@4457048688e7> Message-ID-Hash: QDKRDZZROSAOEOWT4LSNO76SPZQH7S7J X-Message-ID-Hash: QDKRDZZROSAOEOWT4LSNO76SPZQH7S7J X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PR] enable 96kHz support for libopus 1.6 (PR #21425) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: hnsteyding via ffmpeg-devel Cc: hnsteyding Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #21425 opened by hnsteyding URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21425 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21425.patch Opus 1.6 now supports 96kHz samplerate: https://www.opus-codec.org/release/stable/2025/12/15/libopus-1_6.html I've created some PRs in HandBrake project (https://github.com/HandBrake/HandBrake): https://github.com/HandBrake/HandBrake/pull/7508 https://github.com/HandBrake/HandBrake/pull/7561 >>From 9c38a5432818cab9b78c273792436cc2b47abaf8 Mon Sep 17 00:00:00 2001 From: hnsteyding Date: Fri, 9 Jan 2026 22:00:09 +0000 Subject: [PATCH 1/3] libavcodec: enable 96kHz support for libopus 1.6 --- libavcodec/libopusdec.c | 2 +- libavcodec/libopusenc.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libavcodec/libopusdec.c b/libavcodec/libopusdec.c index c602499b7c..a16eb4ec76 100644 --- a/libavcodec/libopusdec.c +++ b/libavcodec/libopusdec.c @@ -62,7 +62,7 @@ static av_cold int libopus_decode_init(AVCodecContext *avc) channels = 2; } - avc->sample_rate = 48000; + avc->sample_rate = 96000; avc->sample_fmt = avc->request_sample_fmt == AV_SAMPLE_FMT_FLT ? AV_SAMPLE_FMT_FLT : AV_SAMPLE_FMT_S16; av_channel_layout_uninit(&avc->ch_layout); diff --git a/libavcodec/libopusenc.c b/libavcodec/libopusenc.c index 131886c8ea..0fbfb38982 100644 --- a/libavcodec/libopusenc.c +++ b/libavcodec/libopusenc.c @@ -97,7 +97,7 @@ static void libopus_write_header(AVCodecContext *avctx, int stream_count, bytestream_put_buffer(&p, "OpusHead", 8); bytestream_put_byte(&p, 1); /* Version */ bytestream_put_byte(&p, channels); - bytestream_put_le16(&p, avctx->initial_padding * 48000 / avctx->sample_rate); /* Lookahead samples at 48kHz */ + bytestream_put_le16(&p, avctx->initial_padding * 96000 / avctx->sample_rate); /* Lookahead samples at 96kHz */ bytestream_put_le32(&p, avctx->sample_rate); /* Original sample rate */ bytestream_put_le16(&p, 0); /* Gain of 0dB is recommended. */ @@ -267,7 +267,7 @@ static av_cold int libopus_encode_init(AVCodecContext *avctx) int coupled_stream_count, header_size, frame_size; int mapping_family; - frame_size = opus->opts.frame_duration * 48000 / 1000; + frame_size = opus->opts.frame_duration * 96000 / 1000; switch (frame_size) { case 120: case 240: @@ -289,7 +289,7 @@ static av_cold int libopus_encode_init(AVCodecContext *avctx) case 5760: #endif opus->opts.packet_size = - avctx->frame_size = frame_size * avctx->sample_rate / 48000; + avctx->frame_size = frame_size * avctx->sample_rate / 96000; break; default: av_log(avctx, AV_LOG_ERROR, "Invalid frame duration: %g.\n" @@ -577,7 +577,7 @@ static const FFCodecDefault libopus_defaults[] = { }; static const int libopus_sample_rates[] = { - 48000, 24000, 16000, 12000, 8000, 0, + 96000, 48000, 24000, 16000, 12000, 8000, 0, }; const FFCodec ff_libopus_encoder = { -- 2.49.1 >>From 0cd5b35459f770d7780cfd37335594dc605cfa22 Mon Sep 17 00:00:00 2001 From: hnsteyding Date: Fri, 9 Jan 2026 22:01:14 +0000 Subject: [PATCH 2/3] libavcodec/opus: enable 96kHz support for libopus 1.6 --- libavcodec/opus/dec.c | 2 +- libavcodec/opus/enc.c | 4 ++-- libavcodec/opus/parser.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/opus/dec.c b/libavcodec/opus/dec.c index 29c490ae37..58df2c7d4a 100644 --- a/libavcodec/opus/dec.c +++ b/libavcodec/opus/dec.c @@ -684,7 +684,7 @@ static av_cold int opus_decode_init(AVCodecContext *avctx) int ret; avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; - avctx->sample_rate = 48000; + avctx->sample_rate = 96000; c->fdsp = avpriv_float_dsp_alloc(0); if (!c->fdsp) diff --git a/libavcodec/opus/enc.c b/libavcodec/opus/enc.c index 8d20b6c192..b171f99a98 100644 --- a/libavcodec/opus/enc.c +++ b/libavcodec/opus/enc.c @@ -649,7 +649,7 @@ static av_cold int opus_encode_init(AVCodecContext *avctx) if (!avctx->bit_rate) { int coupled = ff_opus_default_coupled_streams[s->channels - 1]; - avctx->bit_rate = coupled*(96000) + (s->channels - coupled*2)*(48000); + avctx->bit_rate = coupled*(96000) + (s->channels - coupled*2)*(96000); } else if (avctx->bit_rate < 6000 || avctx->bit_rate > 255000 * s->channels) { int64_t clipped_rate = av_clip(avctx->bit_rate, 6000, 255000 * s->channels); av_log(avctx, AV_LOG_ERROR, "Unsupported bitrate %"PRId64" kbps, clipping to %"PRId64" kbps\n", @@ -746,7 +746,7 @@ const FFCodec ff_opus_encoder = { FF_CODEC_ENCODE_CB(opus_encode_frame), .close = opus_encode_end, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, - CODEC_SAMPLERATES(48000), + CODEC_SAMPLERATES(96000), CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO), CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), }; diff --git a/libavcodec/opus/parser.c b/libavcodec/opus/parser.c index bab0e50412..c16de65494 100644 --- a/libavcodec/opus/parser.c +++ b/libavcodec/opus/parser.c @@ -175,7 +175,7 @@ static int opus_parse(AVCodecParserContext *ctx, AVCodecContext *avctx, ParseContext *pc = &s->pc; int next, header_len = 0; - avctx->sample_rate = 48000; + avctx->sample_rate = 96000; if (avctx->extradata && !s->extradata_parsed) { if (ff_opus_parse_extradata(avctx, &s->ctx) < 0) { -- 2.49.1 >>From a016696be12c8fffa80cf46d12439399f97cfe64 Mon Sep 17 00:00:00 2001 From: hnsteyding Date: Fri, 9 Jan 2026 22:03:06 +0000 Subject: [PATCH 3/3] libavformat: enable 96kHz support for libopus 1.6 --- libavformat/oggenc.c | 2 +- libavformat/oggparseopus.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c index 9a548a8d29..9f44869180 100644 --- a/libavformat/oggenc.c +++ b/libavformat/oggenc.c @@ -492,7 +492,7 @@ static int ogg_init(AVFormatContext *s) if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) { if (st->codecpar->codec_id == AV_CODEC_ID_OPUS) /* Opus requires a fixed 48kHz clock */ - avpriv_set_pts_info(st, 64, 1, 48000); + avpriv_set_pts_info(st, 64, 1, 96000); else avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate); } diff --git a/libavformat/oggparseopus.c b/libavformat/oggparseopus.c index ae4ff22c53..abf45b0f2b 100644 --- a/libavformat/oggparseopus.c +++ b/libavformat/oggparseopus.c @@ -71,10 +71,10 @@ static int parse_opus_header(AVFormatContext *avf, AVStream *st, struct ogg_stre memcpy(st->codecpar->extradata, packet, os->psize); - st->codecpar->sample_rate = 48000; + st->codecpar->sample_rate = 96000; st->codecpar->seek_preroll = av_rescale(OPUS_SEEK_PREROLL_MS, st->codecpar->sample_rate, 1000); - avpriv_set_pts_info(st, 64, 1, 48000); + avpriv_set_pts_info(st, 64, 1, 96000); priv->need_comments = 1; -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org