Closed autogris closed 4 weeks ago
I also get this error when I am using the AAC audio codec. I get what I presume is an identical error with the libmp3lame audio encoder.:
[Muxer::AddStream] Using codec libmp3lame (libmp3lame MP3 (MPEG audio layer 3)). [BaseEncoder::EncoderThread] Encoder thread started. [AudioEncoder::PrepareStream] Using sample format f32p. [libmp3lame @ 0x55ec6c612100] Specified channel layout '2 channels' is not supported by the libmp3lame encoder [libmp3lame @ 0x55ec6c612100] Supported channel layouts: [libmp3lame @ 0x55ec6c612100] mono [libmp3lame @ 0x55ec6c612100] stereo [BaseEncoder::Init] Error: Can't open codec! [BaseEncoder::~BaseEncoder] Stopping encoder thread ... [BaseEncoder::EncoderThread] Encoder thread stopped. [PageRecord::StartOutput] Error: Something went wrong during initialization.
I am using this version in Debian Linux, testing:
SimpleScreenRecorder 0.4.4 Compiled with GCC 14.2.0 Qt: header 5.15.13, lib 5.15.13 libavformat: header 61.1.100, lib 61.1.100 libavcodec: header 61.3.100, lib 61.3.100 libavutil: header 59.8.100, lib 59.8.100 libswscale: header 8.1.100, lib 8.1.100
I replaced this part of the code in the else block with this other part present in the commit https://github.com/MaartenBaert/ssr/pull/1035 https://github.com/MaartenBaert/ssr/blob/4e3ba13dd212fc4213fe0911f371bc7d34033b8d/src/AV/Output/AudioEncoder.cpp#L117-L120 https://github.com/MaartenBaert/ssr/blob/f8988d9f8b48ddfb48079b1a7552c979cff6a912/src/AV/Output/AudioEncoder.cpp#L111-L115 In the end it looked something like this and it worked
#if LIBAVCODEC_VERSION_MAJOR < 61
codec_context->channels = channels;
codec_context->channel_layout = (channels == 1)? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO;
#else
if(channels == 1) {
av_channel_layout_from_mask(&codec_context->ch_layout, AV_CH_LAYOUT_MONO);
} else {
av_channel_layout_from_mask(&codec_context->ch_layout, AV_CH_LAYOUT_STEREO);
}
#endif
Thanks, I've compiled with your patch and it works!
Hi, after upgrading ffmpeg to 7.0.2 from 6.x, SSR gives me the following error when trying to produce an mp4 with h264+aac:
I'm on the latest git commit (https://github.com/MaartenBaert/ssr/commit/4e3ba13dd212fc4213fe0911f371bc7d34033b8d)