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