Patch via
https://github.com/HandBrake/HandBrake/commit/8a0847806d558b252daceb5610d2ba61f7e9ba5a

you can test it with matrixbench trailer:

bin/cin /home/admin/K38/files/home/HUAWEI/home/matrixbench_highdivx_ac3.avi

and set encoder to FFMPEG webm - libopus (and video encoder of your choice).

For some reason 4 ch. still does not work, but those files must be rare
(made one by accident, trying to encode 2 stereo tracks avi into mp4
without any  audio track disabling)
From 4e558d31dcd92a93154d286aa1d292ec960f0193 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Mon, 22 Apr 2024 11:26:21 +0300
Subject: [PATCH] Set mapping_family to 1 for 5.1 libopus

---
 cinelerra-5.1/cinelerra/ffmpeg.C | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/cinelerra-5.1/cinelerra/ffmpeg.C b/cinelerra-5.1/cinelerra/ffmpeg.C
index 9b8832dd..1f00b883 100644
--- a/cinelerra-5.1/cinelerra/ffmpeg.C
+++ b/cinelerra-5.1/cinelerra/ffmpeg.C
@@ -2951,6 +2951,10 @@ int FFMPEG::open_encoder(const char *type, const char *spec)
 				sprintf(arg, "%d", ctx->global_quality);
 				av_dict_set(&sopts, "global_quality", arg, 0);
 			}
+			if(!strcmp(codec_name, "libopus")) {
+			    if(asset->channels > 2)
+				av_dict_set(&sopts, "mapping_family", "1", 0);
+			}
 			int aidx = ffaudio.size();
 			int fidx = aidx + ffvideo.size();
 			FFAudioStream *aud = new FFAudioStream(this, st, aidx, fidx);
-- 
2.35.8

-- 
Cin mailing list
[email protected]
https://lists.cinelerra-gg.org/mailman/listinfo/cin

Reply via email to