Opened 3 years ago

Closed 3 years ago

#7291 closed defect (fixed)

24bit flac converted to alac, bit-depth atom in output file incorrectly set at 16bit

Reported by: pssturges Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mov alac
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug: 24bit flac converted to alac, bit-depth atom in output file incorrectly set at 16bit not 24bit
How to reproduce:

% ffmpeg -i 24bitflac.flac -y -map 0:0 -c:a:0 alac 24bitalac.m4a
ffmpeg version 2.8.14-0ubuntu0.16.04.1
mp4file --dump 24bitalac.m4a | grep sample
        "24bitalac.m4a": sampleSize = 16 (0x0010)
       "24bitalac.m4a": sampleSize = 0 (0x00000000)
       "24bitalac.m4a": sampleCount = 6096 (0x000017d0)

This causes the resultant file to play as white noise in some players as they attempt to play it as 16bit file. Logitech Media Server is one such player.

An extensive investigation of this issue can be found on the slim devices forum found here:
https://forums.slimdevices.com/showthread.php?102059-24-bit-ALAC-files-being-truncated-to-16-bit

Forum member 'bpa' has suggested a patch in that thread which I have tested and found to correct the problem

Attachments (1)

24bitflac.flac (498.5 KB ) - added by pssturges 3 years ago.

Download all attachments as: .zip

Change History (5)

by pssturges, 3 years ago

Attachment: 24bitflac.flac added

in reply to:  description comment:1 by Carl Eugen Hoyos, 3 years ago

Component: ffmpegavformat
Keywords: mov alac added
Version: unspecifiedgit-master

Replying to pssturges:

Forum member 'bpa' has suggested a patch in that thread which I have tested and found to correct the problem

Then why did you open this ticket?
Please send the patch - made with correct attribution and git format-patch - to the development mailing list.

comment:2 by bpa, 3 years ago

My understanding of patches sent to developmentlist is that have to had run the regression test which I havne't done.
https://www.ffmpeg.org/developer.html#Submitting-patches

comment:3 by bpa, 3 years ago

The patch is to libavformat/movenc.c but it has been updated since I created the "patch" so line number may be wrong.
1081,1083c1085

<             
<             if (track->par->codec_id == AV_CODEC_ID_FLAC ||
<                 track->par->codec_id == AV_CODEC_ID_ALAC) {
---
>             if (track->par->codec_id == AV_CODEC_ID_FLAC) {
Last edited 3 years ago by bpa (previous) (diff)

comment:4 by Elon Musk, 3 years ago

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