[FFmpeg-user] converting AV_SAMPLE_FMT_S16 to AV_SAMPLE_FMT_S16P

Andrey Utkin andrey.krieger.utkin at gmail.com
Sun Oct 21 16:18:12 CEST 2012


2012/10/20 Sean <sean at ispyconnect.com>:
> Hello, would appreciate any help with this, not getting anywhere fast.
>
> I'm updating my code from the older version of ffmpeg (53) to the newer
> (54/55). Code that did work has now been deprecated or removed so i'm having
> problems updating it.
> Previously I could create a stereo MP3 file using a sample format called:
>
> SAMPLE_FMT_S16
>
> That matched up perfectly with my source stream. This has now been replaced
> with
>
> AV_SAMPLE_FMT_S16
>
> Which works fine for mono recordings but when I try to create a stereo MP3
> file it bugs out at avcodec_open2 with:
>
> "Specified sample_fmt is not supported."
>
> Through trial and error I've found that using
>
> AV_SAMPLE_FMT_S16P
>
> ...is accepted by avcodec_open2

Using libavfilter 'aformat' audio filter you can seamlessly convert
your raw data between any sample formats.

-- 
Andrey Utkin


More information about the ffmpeg-user mailing list