FFmpegAudioDecoder 是否应该在附加新的初始化段时重新初始化

Is FFmpegAudioDecoder supposed to reinitialize upon append of new init segment

提问人:martin 提问时间:11/14/2023 更新时间:11/14/2023 访问量:21

问:

我正在尝试切换音轨,但在切换时,FFmpegAudioDecoder 永远不会像处理不同分辨率的视频轨道那样重新初始化。我不确定这是否是 FFmpegAudioDecoder 的预期行为,并希望了解有关预期行为的更多信息。

切换音轨时,我最终会调用以下操作:

if sourceBuffer.getIsUpdate() {sourceBuffer.abort()}
sourceBuffer.remove(0-videoDuration)
initSegmentDataStream = fetch init segment of new audio representation
sourceBuffer.appendBuffer(initSegmentDataStream)

这些是初始视频加载中的“媒体”选项卡消息

ChunkDemuxer
Selected FFmpegAudioDecoder for audio decoding, config: codec: aac, profile: unknown, bytes_per_channel: 2, channel_layout: STEREO, channels: 2, samples_per_second: 48000, sample_format: Signed 16-bit, bytes_per_frame: 4, seek_preroll: 0us, codec_delay: 0, has extra data: false, encryption scheme: Unencrypted, discard decoder delay: false, target_output_channel_layout: STEREO, target_output_sample_format: Unknown sample format, has aac extra data: true
Cannot select DecryptingVideoDecoder for video decoding
Cannot select VDAVideoDecoder for video decoding
Cannot select VpxVideoDecoder for video decoding
Selected Dav1dVideoDecoder for video decoding, config: codec: av1, profile: av1 profile main, level: not available, alpha_mode: is_opaque, coded size: [1280,720], visible rect: [0,0,1280,720], natural size: [1280,720], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}
Dropping audio frame (DTS 0us PTS -105375us,-62709us) that is outside append window [0us,9223372036854775807us).
Dropping audio frame (DTS 42666us PTS -62708us,-20042us) that is outside append window [0us,9223372036854775807us).
Truncating audio buffer which overlaps append window start. PTS -20041us frame_end_timestamp 22625us append_window_start 0us
Effective playback rate changed from 0 to 1

相比之下,这是我在附加不同视频分辨率/轨道的初始化段时得到的

video decoder config changed midstream, new config: codec: av1, profile: av1 profile main, level: not available, alpha_mode: is_opaque, coded size: [1920,1080], visible rect: [0,0,1920,1080], natural size: [1920,1080], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}

Chrome 版本:版本 119.0.6045.123(官方版本)

在附加音频轨道的新 init 段时,我希望 FFmpegAudioDecoder 能够像 Dav1dVideoDecoder 对视频轨道所做的那样重新初始化

javascript google-chrome ffmpeg 视频流 html5-video

评论


答: 暂无答案