[FFmpeg-devel] [PATCH] examples: add resampling_audio.c file

Michael Niedermayer michaelni at gmx.at
Sat Dec 1 05:09:04 CET 2012


On Fri, Nov 30, 2012 at 11:42:43PM +0100, Stefano Sabatini wrote:
> On date Friday 2012-11-30 19:58:51 +0100, Stefano Sabatini encoded:
> > ---
> >  doc/examples/Makefile           |    3 +-
> >  doc/examples/resampling_audio.c |  208 +++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 210 insertions(+), 1 deletion(-)
> >  create mode 100644 doc/examples/resampling_audio.c
> 
> Upped.
> 
> Note, this doesn't work if I change destination layout MONO ->
> SURROUND, I got:
> $ resampling_audio out.raw
> ...
> Resampling succeeded. Play the output file with the command:
> ffplay -f s16le -channel_layout 7 -ac 3 -ar 44100 out.raw
> $ ffplay -f s16le -channel_layout 7 -ac 3 -ar 44100 out.raw
> ffplay version N-46906-ga5e382a Copyright (c) 2003-2012 the FFmpeg developers
> [...]
> [s16le @ 0x7f11080042d0] Estimating duration from bitrate, this may be inaccurate
> Input #0, s16le, from 'out.raw':
>   Duration: 00:00:10.01, start: 0.000000, bitrate: 2116 kb/s
>     Stream #0:0: Audio: pcm_s16le, 44100 Hz, 3.0, s16, 2116 kb/s
> SDL_OpenAudio (3 channels): 1 (mono) and 2 (stereo) channels supported
> [pcm_s16le @ 0x7f1108000ad0] Invalid PCM packet, data has size 2 but at least a size of 6 was expected
> 
> and I got distorted sound. Any hint?

try -channels 3

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121201/e8ff86fc/attachment.asc>


More information about the ffmpeg-devel mailing list