Created attachment 14208 [details] Исходный файл Описание ошибки =============== 1. Проверить многие форматы, которые выводятся в строках "Adding File Format" при запуске fs_encode с флагом -v. Для этого создать файлы для проверки. Например, с помощью исходного файла input.mp3 (во вложении) и ffmpeg (с помощью grep в команде исключены форматы, не поддерживаемые ffmpeg, а для gsm задан sample rate 8000, требуемый ffmpeg (*)): > # ffmpeg -y -i input.mp3 $(fs_encode -v test.1 test.2 2>&1 | grep "Adding File Format" | sed "s/.*Adding File Format '/input./g" | sed "s/'//g" | grep -E '^[a-z0-9\.]+$' | grep -v -E 'avr|htk|iff|mat|mpc|m1a|paf|pvf|raw|rf64|sd2|sds|wve|xi|r8|r16|r24|r32|ulaw|alaw|adpcm|vox' | sed 's/input.gsm/-ar 8000 input.gsm/g') (*) На результаты с другими форматами изменение sample rate не влияет. Выполнить конвертацию из созданных файлов в wav: > # for infile in $(ls | grep input | grep -v output); do echo "in: $infile:"; fs_encode "$infile" "$infile.output.wav"; done (запускается от имени root из-за https://bugzilla.altlinux.org/47334) Фактический результат ===================== * Вывод для mp3 и oga вида: > Couldn't open input.oga * Вывод для al, au, caf, flac, ogg, sf, ul, voc, w64 и wav вида: > Couldn't initialize codec for flac@8000h@20i * Вывод для gsm: Вывода нет, успешное завершение команды (но см. https://bugzilla.altlinux.org/47344). Ожидаема только ошибка с mp3, т. к. его поддержка не заявляется. Остальные ошибки не ожидаемы. При запуске c -v выводятся ошибки вида: > # fs_encode -v input.flac output.ogg > Opening file input.flac > [...] [DEBUG] switch_core_file.c:444 File input.flac sample rate 44100 doesn't match requested rate 8000 > [...] [WARNING] switch_core_file.c:463 File has 2 channels, muxing to 1 channel will occur. > Opening file output.ogg > [...] [ERR] switch_core_codec.c:670 Invalid codec ogg! > Couldn't initialize codec for ogg@8000h@20i > [...] [WARNING] switch_core_codec.c:932 Codec is not initialized! > [...] [WARNING] switch_core_codec.c:932 Codec is not initialized! Примечания: * Ошибка невозможности "конвертации" wav -> wav отдельная: https://bugzilla.altlinux.org/47345. * Ошибка "Codec is not initialized!" возникает и при успешном завершении конвертации, см. вывод в https://bugzilla.altlinux.org/47344. * Указание "-r 44100" убирает строку с DEBUG, но больше ни на что не влияет. Ожидаемый результат =================== Все выводимые форматы должны поддерживаться. Обратная проверка ================= Проверить обратное (какие форматы поддерживаются в качестве вывода при использовании входного файла input.gsm/wav) можно с помощью команды: > # for ext in $(ls | grep input | grep -v output | sed 's/input\.//g'); do echo "gsm -> $ext:"; fs_encode "input.gsm" "gsm-output.$ext"; echo "wav -> $ext:"; fs_encode "input.wav" "wav-output.$ext"; done Исходя из вывода этой команды, работает конвертация только {wav,gsm} -> gsm и gsm -> wav. Дополнительно ============= Для файлов mp3, поддержка которого не указана, выводится ошибка вида: > # fs_encode input.mp3 output.ogg > Couldn't open input.mp3 Она более понятна из вывода c -v: > # fs_encode -v input.mp3 output.ogg | grep mp3 > Opening file input.mp3 > Couldn't open input.mp3 > 2023-08-25 10:44:55.092209 100.00% [ERR] switch_core_file.c:346 Invalid file format [mp3] for [input.mp3]! Не ясно, почему эта ошибка появляется и для oga, о котором программа пишет в своём выводе. Воспроизводимость ================= Воспроизводится на виртуальных машинах: [p10] server-10.1-x86-64 freeswitch-daemon-1.10.9-alt1.x86_64 ffmpeg-4.4.4-alt1.x86_64 [sisyphus] server-10.1-x86-64 freeswitch-daemon-1.10.10-alt1.x86_64 ffmpeg-4.4.4-alt1.x86_64
freeswitch-1:1.11.2-alt1 -> sisyphus: Thu Aug 13 2026 Anton Farygin <rider@altlinux> 1:1.11.2-alt1 - 1.11.1 -> 1.11.2 - fs_encode: treat only the part after the last dot as the file extension (Closes: 56577) - fs_encode: only use the output extension as a codec when it names a real codec; formats encoded by the file module (wav, flac, ogg, ...) now work as output, wav -> wav included (Closes: 47345, 47348) - fs_encode: do not encode twice when the output extension is claimed by mod_sndfile (gsm, ...): the file was gsm-compressed by the codec and then again by libsndfile, producing short noise-only files (Closes: 47344) - fs_tts: fixed argument handling: the text argument was ignored unless an extra argument followed it, and -i FILE was unreachable so the tool hung on stdin instead of reading the file; extra arguments are rejected now (Closes: 54889) - switch_xml: do not abort on assert in switch_xml_open_cfg() when the main configuration could not be loaded; fixes fs_tts/fs_encode/ tone2wav crash under a regular user (Closes: 47334) - fs_tts: load mod_dptools (tts:// provider) instead of mod_ssml removed upstream, and load the module of the selected TTS engine (mod_flite by default), so text-to-speech actually works (Closes: 47335) - mod_imagick: bound the lazy loading thread by the real page count; fixes endless re-reading of GIF frames with lazy=1 ending in an OOM kill (Closes: 47382) - mod_xml_rpc: build against the bundled xmlrpc-c as upstream intends instead of mixing bundled private headers with the system library; fixes the HTTP server failing to start and every /api, /webapi, /portal request answered with 404, which broke freeswitch-webui (Closes: 47399, 54894) - added a native systemd unit ordered after network-online.target; the unit generated from the SysV script started freeswitch before the network was up, so after a reboot sofia bound to the wrong address and clients could not connect (Closes: 47333) - freeswitch-vlc: require vlc-mini: without the VLC core plugins libvlc_new() returns NULL and mod_vlc fails with "cannot initialise VLC handle" on every call (Closes: 47403) - freeswitch-lang-he: package mod_say_he.so; the subpackage shipped the Hebrew prompts without the module that speaks them - packaged gentls_cert, the TLS certificate helper for sofia and verto - dropped mod_say_hu, mod_say_it and mod_say_nl from the build: they were built and thrown away, upstream ships no lang data for them - do not install the switch_eavesdrop unit test into the bin dir, the unnamespaced /usr/include/test headers, and the Flash-era htdocs leftovers - run the network-free part of tests/unit at build time (switch_utils, switch_hash, switch_event, switch_xml, switch_console); the binaries were already being built and thrown away