[Libav-user] problem while using swresample library
Rafi Fisher
rafi.fisher at wywy.com
Tue Dec 4 17:29:42 CET 2012
hello
the above problem was solved. since i did not have the latest ffmpeg
libs version downloaded.
still i have some problem when for example transcoding :
from: mp4 file 48khz 16bit stereo downsampled to
to : wav file 11khz 16bit stereo
i dont get the same wav file compared to the wav file i got by ruuning the
ffmpeg.exe utility
my file size is smaller & the quality of the audio less good compared to
the ffmpeg.exe wav file.
do you have an idea why i get different results ?
because when i transcode without downsampling i get excatlly the same wav
file.
thanks a lot rafi
On Tue, Dec 4, 2012 at 12:14 PM, Stefano Sabatini <stefasab at gmail.com>wrote:
> On date Monday 2012-12-03 17:52:57 +0200, Rafi Fisher encoded:
> > hello
> >
> > i'm using *swresample lib*. my code is used to convert mp2 or mp4 into
> > wav file.
> > the code fragment :
> > .......
> >
> > SwrContext *swr = swr_alloc();
> > ret = av_opt_set_int(swr, "in_channel_layout", AV_CH_LAYOUT_STEREO,
> 0);
> > ret = av_opt_set_int(swr, "out_channel_layout", AV_CH_LAYOUT_MONO,
> > 0);
> > ret = av_opt_set_int(swr, "in_sample_rate", IN_SAMPLE_RATE,
> 0);
> > ret = av_opt_set_int(swr, "out_sample_rate", OUT_SAMPLE_RATE,
> 0);
> > ret = av_opt_set_int(swr, "in_sample_fmt", AV_SAMPLE_FMT_S16,
> 0);
> > ret = av_opt_set_int(swr, "out_sample_fmt", AV_SAMPLE_FMT_S16,
> 0);
> > ret = swr_init(swr);
> >
> > .......
> >
> > out_samples = swr_convert(swr, output, out_samples,(const uint8_t **)
> > (inframe->data), in_samples);
> > if out_channel_layout = AV_CH_LAYOUT_ STEREO resampling works fine
> >
> > if out_channel_layout = AV_CH_LAYOUT_MONO & other set options remain
> > same it fails that is:
> >
>
> > the swr_convert fails that is somwhere inside the code of this
> function
> > there is a call to* exit* which is problematic by itself (exit a
> program from av. library)
> > instead of returning some error code.
> >
>
> There is no call to exit() in libswresample, it seems more likely like
> a crash. Make sure that you correctly allocated the samples buffers.
>
> Also check my recently posted resampling example:
> http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/155151
>
> > help will be appreciated thanks rafi
> --
> FFmpeg = Forgiving and Fostering Mega Puristic Explosive Genius
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20121204/b989ab1d/attachment.html>
More information about the Libav-user
mailing list