Opened 2 years ago

Closed 2 years ago

#9593 closed defect (duplicate)

alac encoder does no support 20bits depth

Reported by: Michael Owned by:
Priority: normal Component: avcodec
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
alac decoder support 20 bits bit depth, but encoder does not.
seems fixed bit depth in code.
---

if (avctx->sample_fmt == AV_SAMPLE_FMT_S32P) {

if (avctx->bits_per_raw_sample != 24)

av_log(avctx, AV_LOG_WARNING, "encoding as 24 bits-per-sample\n");

avctx->bits_per_raw_sample = 24;

} else {

avctx->bits_per_raw_sample = 16;
s->extra_bits = 0;

}

---
How to reproduce:

C:\Data\ffmpeg.exe  -i 008.alac20.c2.caf -codec alac 008.m4a
ffmpeg version n4.4.1-14-g5a7763bdfa-20220108 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11.2.0 (crosstool-NG 1.24.0.498_5075e1f)
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-nonfree --enable-gpl --enable-version3 --disable-debug --enable-shared --disable-static --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --enable-libdavs2 --enable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --disable-frei0r --enable-libgme --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librist --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --disable-vaapi --enable-libvidstab --disable-vulkan --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20220108
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Input #0, caf, from '008.alac20.c2.caf':
  Duration: 00:04:05.76, start: 0.000000, bitrate: 782 kb/s
  Stream #0:0: Audio: alac (alac / 0x63616C61), 44100 Hz, stereo, s32p (20 bit), 705 kb/s
File '008.m4a' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (alac (native) -> alac (native))
Press [q] to stop, [?] for help
[alac @ 0000015e13ff3dc0] encoding as 24 bits-per-sample
Output #0, ipod, to '008.m4a':
  Metadata:
    encoder         : Lavf58.76.100
  Stream #0:0: Audio: alac (alac / 0x63616C61), 44100 Hz, stereo, s32p (24 bit), 128 kb/s
    Metadata:
      encoder         : Lavc58.134.100 alac
size=   35154kB time=00:04:05.66 bitrate=1172.3kbits/s speed= 155x
video:0kB audio:35143kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.032632%

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Change History (1)

comment:1 by Michael, 2 years ago

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.