stunndard / goicy

AAC and MPEG (MP1, MP2, MP3) Icecast/Shoutcast source client written in Go
69 stars 15 forks source link

Use explicit channel-configuration when in ffmpeg-mode #4

Closed MrShoenel closed 7 years ago

MrShoenel commented 7 years ago

I have encountered an issue when using ffmpeg, libfdk_aac and the he_v2 profile. That profile only supports stereo and some of my tracks in one folder are mono.

Now I have seen that the "-ac"-flag for libmp3lame and libfdk_aac has been commented out. When I comment it in and recompile goicy, all my tracks work fine. Is there a reason for why this has been commented out?

I can open a pull request if you want :)

stunndard commented 7 years ago

I already don't remember clearly why I commented the "-ac", but I remember something was wrong with ffmpeg under some conditions if I used the "-ac". I guess it was ffmpeg failing with stereo files and "-ac 1" flag? Can you confirm it's working now both with "-ac 1" and "-ac 2" and with stereo and mono files in any combination?

MrShoenel commented 7 years ago

I have made some tests with the current ffmpeg (see end of post). When using the aac_he_v2 profile, a configuration with mono is not allowed. If you try to encode a mono track with that profile without explicit channel configuration, it fails (because it then maps mono to mono). Encoding a mono file with that profile and "-ac 2" it works flawlessly. Encoding a stereo file to mono with "-ac 1" works (I have tried "-c:a flac" and "-c:a libvorbis" only).

Encoding a mono file to stereo works as well, with "-ac 2". An example I have tried: ffmpeg.exe -i mono.ogg -c:a libfdk_aac -profile:a aac_he_v2 -b:a 24k -ac 2 -ar 48000 stereo.m4a

So I guess that ffmpeg is fine. I created a pull request.

ffmpeg version N-86098-g3fefaea Copyright (c) 2000-2017 the FFmpeg developers built with gcc 4.9.4 (GCC) configuration: --arch=x86_64 --target-os=mingw32 --cross-prefix=/root/ffmpeg_build/sandbox/cross_compilers/mingw-w64-x86_64/bin/x86_64-w64-mingw32- --pkg-config=pkg-config --disable-w32threads --enable-libsoxr --enable-fontconfig --enable-libass --enable-libbluray --enable-iconv --enable-libtwolame --extra-cflags=-DLIBTWOLAME_STATIC --enable-libzvbi --enable-libcaca --enable-libmodplug --extra-libs=-lstdc++ --extra-libs=-lpng --extra-libs=-loleaut32 --enable-libmp3lame --enable-version3 --enable-zlib --enable-librtmp --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libopenjpeg --enable-gnutls --enable-libgsm --enable-libfreetype --enable-libopus --enable-bzlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libschroedinger --enable-libvpx --enable-libilbc --enable-libwavpack --enable-libwebp --enable-libgme --enable-dxva2 --enable-gray --enable-libopenh264 --enable-netcdf --enable-libflite --enable-lzma --enable-libsnappy --enable-libzimg --enable-gpl --enable-libx264 --enable-libx265 --enable-frei0r --enable-filter=frei0r --enable-librubberband --enable-libvidstab --enable-libxavs --enable-libxvid --enable-avisynth --enable-libmfx --enable-avresample --extra-libs=-lpsapi --extra-libs=-lspeexdsp --extra-cflags='-mtune=generic' --extra-cflags=-O3 --enable-static --disable-shared --enable-nonfree --enable-libfdk-aac --enable-decklink --enable-runtime-cpudetect libavutil 55. 63.100 / 55. 63.100 libavcodec 57. 96.101 / 57. 96.101 libavformat 57. 72.101 / 57. 72.101 libavdevice 57. 7.100 / 57. 7.100 libavfilter 6. 89.101 / 6. 89.101 libavresample 3. 6. 0 / 3. 6. 0 libswscale 4. 7.101 / 4. 7.101 libswresample 2. 8.100 / 2. 8.100 libpostproc 54. 6.100 / 54. 6.100

stunndard commented 7 years ago

thanks for testing :)