I've been trying to
write compressed audio frames to a container with av_interleaved_frame
and I am seeing strange results. The source audio is a single tone of
constant amplitude, mono, which I can see I am decompressing fine when I
plot all the values to a graph.
Depending on the format/codec combo I see:
- a monotone signal randomly interspersed with noise or silence.
- a short playback of a distorted tone
- correct length playback of a monotone with varying amplitude
the section of code where I compress and write a frame to a container,
it works perfectly for video. The ffmpeg library does not produce any
messages during writing.
I have searched on
what could be the cause of this and the topic of correctly setting
packet->pts/dts comes up regularly. However, I believe I am doing the