Re: [FFmpeg-user] MLP encoder: encodes 24-bit wav files into 16-bit MLP
Thanks for this prompt reply. I'll be testing the recompiled-reactivated 24 bit encoder so that MLP can be added to the free DVD-Audio authoring software dvda-author ( http://dvd-audio.sourceforge.com), which is currently being improved. Hopefully Jai can fix remaining issues and let me know. Best Fabrice Nicol Le dim. 7 juil. 2019 03:58, Moritz Barsnick a écrit : > On Sat, Jul 06, 2019 at 03:57:38 +0200, fabrice nicol wrote: > > ffmpeg is build from git source code. Choosing a simple 2-channel 24 > > -bit 96khz wav file yields: > > > >`~ $ /usr/local/bin/ffmpeg -i a_2_24_96.wav -c:a mlp -strict > experimental a_2_24_96.mlp` > [...] > > Input #0, wav, from 'a_2_24_96.wav': > >Duration: 00:14:14.05, bitrate: 4608 kb/s > > Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 96000 Hz, > stereo, s32 (24 bit), 4608 kb/s > [...] > > Stream #0:0: Audio: mlp, 96000 Hz, stereo, s16, 128 kb/s > [...] > > Is this a limitation of the currently still experimental encoder or am I > > doing something wrong? > > Indeed, this seems to be a limitation of the mlp encoder: > > $ ffmpeg -h encoder=mlp > [...] > Supported sample formats: s16 > > But looking at the code (mplenc.c), there does seem to be support for > 24 bit MLP in there. It just can't be accessed, because the encoder is > not configured to accept such input: > > .sample_fmts= (const enum AVSampleFormat[]) > {AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE}, > (This is a list of supported input formats.) > > If you edit this line to: > .sample_fmts= (const enum AVSampleFormat[]) > {AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE}, > > and recompile, it seems to actually produce 24 bit output. (And this > output plays with ffplay and mpv at least, which both use libavcodec to > decode though). > > The reason for the support missing can be read in the commit message: > > https://github.com/FFmpeg/FFmpeg/commit/15b86f480a9c748aeeafb42a877ee755c64f90f2 > > * 32-bit sample support has been removed for now, will add it later > > While testing, some samples gave lossless check failures when enforcing > s32. Probably this will also get solved with the LFE issues. > > So it was disabled because some encodings were incorrect. > > Cheers, > Moritz > ___ > ffmpeg-user mailing list > ffmpeg-user@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-user > > To unsubscribe, visit link above, or email > ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] MLP encoder: encodes 24-bit wav files into 16-bit MLP
I'm experiencing a parallel issue with encoding, the reverse operation of my previous question about the MLP decoder. ffmpeg is build from git source code. Choosing a simple 2-channel 24 -bit 96khz wav file yields: `~ $ /usr/local/bin/ffmpeg -i a_2_24_96.wav -c:a mlp -strict experimental a_2_24_96.mlp` ffmpeg version git-2019-07-05-7c64498 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 9.1.0 (Gentoo 9.1.0-r1 p1.1) configuration: libavutil 56. 30.100 / 56. 30.100 libavcodec 58. 53.101 / 58. 53.101 libavformat 58. 28.101 / 58. 28.101 libavdevice 58. 7.100 / 58. 7.100 libavfilter 7. 56.100 / 7. 56.100 libswscale 5. 4.101 / 5. 4.101 libswresample 3. 4.100 / 3. 4.100 Input #0, wav, from 'a_2_24_96.wav': Duration: 00:14:14.05, bitrate: 4608 kb/s Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 96000 Hz, stereo, s32 (24 bit), 4608 kb/s Stream mapping: Stream #0:0 -> #0:0 (pcm_s24le (native) -> mlp (native)) Press [q] to stop, [?] for help Output #0, mlp, to 'a_2_24_96.mlp': Metadata: encoder : Lavf58.28.101 Stream #0:0: Audio: mlp, 96000 Hz, stereo, s16, 128 kb/s Metadata: encoder : Lavc58.53.101 mlp size= 138569kB time=00:14:14.05 bitrate=1329.1kbits/s speed=57.8x video:0kB audio:138569kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.00% The output is 16-bit depth not 24-bit: Input #0, mlp, from 'a_2_24_96.mlp': Duration: N/A, start: 0.00, bitrate: N/A Stream #0:0: Audio: mlp, 96000 Hz, stereo,s16 Is this a limitation of the currently still experimental encoder or am I doing something wrong? Fabrice Le 03/07/2019 à 11:17, Moritz Barsnick a écrit : On Wed, Jul 03, 2019 at 10:17:57 +0200, fabrice nicol wrote: The MLP decoder does not seem to work for 24-bit MLP. It converts such files into 16-bit WAV, whatever the sample rate. Actually, you could think so. But the decoder is fine. On the other hand, the wav output format defaults to 16 bits. `ffmpeg -i /mnt/cdrom/AUDIO_TS/ATS_01_3.AOB ~/a.wav` [...] Stream mapping: Stream #0:0 -> #0:0 (mlp (native) -> pcm_s16le (native)) [...] Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 96000 Hz, 5.1, s16, 9216 kb/s Just add "-c:a pcm_s24le" as an output option. Then you get the full sample depth. sox --i a.wav Tested and confirmed with sox here as well. ;-) Hope this helps, Moritz ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] MLP decoder: decodes 24-bit MLP files into 16-bit MLP wav
The MLP decoder does not seem to work for 24-bit MLP. It converts such files into 16-bit WAV, whatever the sample rate. Example from a (non-encrypted) commercial disc: check the telling chunk: " Stream #0:0[0xa1]: Audio: mlp, 96000 Hz, 5.1, s32 (24 bit) Stream mapping: Stream #0:0 -> #0:0 (mlp (native) -> pcm_s16le (native))" Complete output: `ffmpeg -i /mnt/cdrom/AUDIO_TS/ATS_01_3.AOB ~/a.wav` ffmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 9.1.0 (Gentoo 9.1.0 p1.0) configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --docdir=/usr/share/doc/ffmpeg-4.1.3/html --mandir=/usr/share/man --enable-shared --cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar --optflags='-O2 -pipe -march=core-avx2' --enable-static --enable-avfilter --enable-avresample --disable-stripping --disable-optimizations --disable-libcelt --disable-indev=v4l2 --disable-outdev=v4l2 --disable-indev=oss --disable-indev=jack --disable-outdev=oss --enable-bzlib --disable-runtime-cpudetect --disable-debug --disable-gcrypt --disable-gnutls --disable-gmp --enable-gpl --enable-hardcoded-tables --enable-iconv --disable-libtls --disable-libxml2 --disable-lzma --enable-network --disable-opencl --disable-openssl --enable-postproc --disable-libsmbclient --enable-ffplay --enable-sdl2 --disable-vaapi --enable-vdpau --enable-xlib --enable-libxcb --enable-libxcb-shm --enable-libxcb-xfixes --enable-zlib --disable-libcdio --disable-libiec61883 --disable-libdc1394 --disable-libcaca --disable-openal --enable-opengl --disable-libv4l2 --enable-libpulse --disable-libdrm --disable-libjack --disable-libopencore-amrwb --disable-libopencore-amrnb --disable-libcodec2 --disable-libfdk-aac --disable-libopenjpeg --disable-libbluray --disable-libgme --disable-libgsm --disable-mmal --disable-libmodplug --disable-libopus --disable-libilbc --disable-librtmp --disable-libssh --disable-libspeex --disable-libsrt --enable-librsvg --disable-ffnvcodec --enable-libvorbis --disable-libvpx --disable-libzvbi --disable-appkit --disable-libbs2b --disable-chromaprint --disable-libflite --disable-frei0r --disable-libfribidi --disable-fontconfig --disable-ladspa --disable-libass --disable-lv2 --enable-libfreetype --disable-librubberband --disable-libzmq --disable-libzimg --disable-libsoxr --enable-pthreads --disable-libvo-amrwbenc --enable-libmp3lame --disable-libkvazaar --disable-libaom --disable-libopenh264 --disable-libsnappy --disable-libtheora --disable-libtwolame --disable-libwavpack --disable-libwebp --enable-libx264 --disable-libx265 --enable-libxvid --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-neon --disable-vfp --disable-vfpv3 --disable-armv8 --disable-mipsdsp --disable-mipsdspr2 --disable-mipsfpu --disable-altivec --disable-amd3dnow --disable-amd3dnowext --disable-aesni --disable-avx --disable-avx2 --disable-fma3 --disable-fma4 --disable-sse3 --disable-ssse3 --disable-sse4 --disable-sse42 --disable-xop --cpu=core-avx2 --disable-doc --disable-htmlpages --enable-manpages libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat 58. 20.100 / 58. 20.100 libavdevice 58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100 libpostproc 55. 3.100 / 55. 3.100 Input #0, mpeg, from '/mnt/cdrom/AUDIO_TS/ATS_01_3.AOB': Duration: 26:29:22.18, start: 143.151067, bitrate: 47 kb/s Stream #0:0[0xa1]: Audio: mlp, 96000 Hz, 5.1, s32 (24 bit) Stream mapping: Stream #0:0 -> #0:0 (mlp (native) -> pcm_s16le (native)) Press [q] to stop, [?] for help Output #0, wav, to '/home/fab2/a.wav': Metadata: ISFT : Lavf58.20.100 Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 96000 Hz, 5.1, s16, 9216 kb/s Metadata: encoder : Lavc58.35.100 pcm_s16le (...) The output is 16-bit depth as indicated in the console messages. Using SoX to corroborate: sox --i a.wav Input File : 'a.wav' Channels : 6 Sample Rate : 96000 Precision : 16-bit Duration : 00:14:14.05 = 81988800 samples ~ 64053.8 CDDA sectors File Size : 984M Bit Rate : 9.22M Sample Encoding: 16-bit Signed Integer PCM My platform is Gentoo Linux amd64. Is this an undocumented limitation of the MLP decoder or is there something I did wrong? ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".