[FFmpeg-trac] #10710(avcodec:new): Audio cracklings when decoding WAV PCM files with avcodec_receive_frame
FFmpeg
trac at avcodec.org
Thu Nov 30 17:55:13 EET 2023
#10710: Audio cracklings when decoding WAV PCM files with avcodec_receive_frame
---------------------------------+-------------------------------------
Reporter: fabi78 | Type: defect
Status: new | Priority: important
Component: avcodec | Version: 6.0
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
---------------------------------+-------------------------------------
The bug concerns FFMPEG API, not ffmpeg program.
To learn how to use FFMPEG API, I wrote a simple WAV file decoder (cf.
attachment). It is inspired by tutorials online. The decoding is performed
by the chain:
av_read_frame -> avcodec_send_packet -> avcodec_receive_frame
Then the content of frame->data is written without modification in an
output file. When I read it with ffplay -f s16le -ac 2 -ar 44100, I hear
cracklings, and when opening the file with Audacity in raw mode, I can see
that some frames are "damaged" (some samples seem random).
But if I wrote the data from the packet instead of the frame (which I can
do as PCM is uncompressed), replacing "fwrite( pFrame->data " by "fwrite(
pPacket->data" (at line 127), everything is fine.
Have a good day.
FM
--
Ticket URL: <https://trac.ffmpeg.org/ticket/10710>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list