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

Stefano Sabatini stefasab at gmail.com
Sat Dec 1 20:21:47 CET 2012


On date Saturday 2012-12-01 05:09:04 +0100, Michael Niedermayer encoded:
> 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

Yes, this fixes it, still ffplay shows the wrong number of channels (6
in place of 3).

Patch updated, will push it in a couple of days, please comment.
-- 
FFmpeg = Faithless and Fostering Martial Puristic Exciting Genius
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-examples-add-resampling_audio.c-file.patch
Type: text/x-diff
Size: 9210 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121201/e020a462/attachment.bin>


More information about the ffmpeg-devel mailing list