通道数为 8 且 mpegtsmux 的 Opus 编码器无法正常工作

通道数为 8 且 mpegtsmux 的 Opus 编码器无法正常工作

管道:gst-launch-1.0 v4l2src 设备=/dev/video0 io-mode=4 num-buffers=3600!video/x-raw,width=3840,height=2160,format=NV12,framerate=60/1!omxh265enc gop-mode=basic gop-length=60 b-frames=0 target-bitrate=60000 max-picture-size=1100 num-slices=8 control-rate=constant prefetch-buffer=true low-bandwidth=false fill-data=true cpb-size=1000 initial-delay=500!video/x-h265,profile=main,alignment=au!queue max-size-bytes=0!mux.alsasrc 设备=hw:1,1!队列!audioconvert!audioresample!音频/x-raw,格式=S16LE,速率=48000,通道=8,布局=交错!队列!opusenc!opusparse!队列最大大小字节数=0!mpegtsmux名称=mux!filesink位置="/run/test.ts"

上述管道不工作,但如果通道=7 它就可以工作。

以下是管道的 GST_DEBUG=3 日志:

0:00:00.150296457 [336m14963[00m   0x5569e15a80 [33;01mWARN   [00m [00m                v4l2 gstv4l2object.c:4382:gst_v4l2_object_probe_caps:<v4l2src0:src>[00m Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Invalid argument
0:00:00.150388856 [336m14963[00m   0x5569e159e0 [32;01mFIXME  [00m [00;04m             default gstutils.c:3980:gst_pad_create_stream_id_internal:<alsasrc0:src>[00m Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:00.151335541 [336m14963[00m   0x5569e15a80 [33;01mWARN   [00m [00m                v4l2 gstv4l2object.c:3205:gst_v4l2_object_save_format:<v4l2src0>[00m format NV16_10LE32 has a pstride of 0, cannot compute padded with
0:00:00.153998227 [336m14963[00m   0x5569e15a80 [33;01mWARN   [00m [00m         omxvideoenc gstomxvideoenc.c:833:gst_omx_video_enc_set_transfer_characteristics:<omxh265enc-omxh265enc0>[00m Provided transfer characteristics 11 (bt2020) are not supported
0:00:00.154525200 [336m14963[00m   0x5569e15a80 [33;01mWARN   [00m [00m                v4l2 gstv4l2object.c:3205:gst_v4l2_object_save_format:<v4l2src0>[00m format NV16_10LE32 has a pstride of 0, cannot compute padded with
0:00:00.173773953 [336m14963[00m   0x5569e159e0 [33;01mWARN   [00m [00m                alsa pcm_hw.c:1359:snd_pcm_hw_get_chmap:[00m alsalib error: Cannot read Channel Map ctl
: No such file or directory
0:00:00.181625698 [336m14963[00m   0x5569e15b20 [33;01mWARN   [00m [00m     audio-resampler audio-resampler.c:274:convert_taps_gint16_c:[00m can't find exact taps
0:00:00.340288901 [336m14963[00m   0x5569e15ad0 [32;01mFIXME  [00m [00m           mpegtsmux mpegtsmux.c:748:mpegtsmux_create_stream:<mux:sink_66>[00m Opus channel mapping not handled
0:00:00.340399272 [336m14963[00m   0x5569e15ad0 [33;01mWARN   [00m [00m           mpegtsmux mpegtsmux.c:1010:mpegtsmux_create_streams:<mux>[00m error: Could not create handler for stream
0:00:00.360425263 [336m14963[00m   0x7f94003800 [33;01mWARN   [00m [00m            omxvideo gstomxvideo.c:223:gst_omx_video_find_nearest_frame:<omxh265enc-omxh265enc0>[00m Difference between ts (0:00:00.000000000) and frame 1 (0:00:00.101057829) seems too high (0:00:00.101057829)
0:00:00.360559206 [336m14963[00m   0x7f94003800 [33;01mWARN   [00m [00m            omxvideo gstomxvideo.c:223:gst_omx_video_find_nearest_frame:<omxh265enc-omxh265enc0>[00m Difference between ts (0:00:00.000000000) and frame 1 (0:00:00.101057829) seems too high (0:00:00.101057829)

似乎有些问题mpegtsmux - Opus 通道映射未处理,所以猜测如果我们提供通道位置使用 rawaudioparse 可能会解决这个问题。但是,通道位置期望 GValueArray 类型的输入,所以我们如何提供这一点我并不确定。

还不确定管道中是否需要任何其他特殊修复。

相关内容