[Libav-user] Grab audio samples with ffmpeg and C, error with official example code

nji9 at arcor.de nji9 at arcor.de
Sat Aug 29 19:39:12 EEST 2020

For dev I'm using v. 4.3.1. and also the latest Git version of ffmpeg (Zeranoe's Windows 64 builds).

I get "strange" problems when running the official example code for decoding audio




Generates pcm, but outputs:

"Warning: the sample format the decoder produced is planar (s16p).
This example will output the first channel only."

But the output pcm has both channels!??

When recoding the above mp3 to wav with ffmpeg (4.1.4, no error message)


and also when recoding the latter to mp3 again


the example code breaks and produces these error messages ("mp2 @ ..." also for the wav file):

avcodec_send_packet ()
from within:
"[mp2 @ <someAddress>] Header missing"
and returns error code -1094995529
(= "Invalid data found when processing input")

It produces that error message for literally all other formats I tried, and also when written with another editor (Audition 3.0). 
But all the files play and show fine on all programs I have.

I'm at a lost at this point. What is going on and wrong here?

More information about the Libav-user mailing list