<div dir="ltr"><div><div><div><div><div><div><div>Hi Carl,<br><br></div>On your suggestion, I downloaded latest available build from Zeranoe site: ffmpeg-20130623-git-c329713-win32. I had some trouble getting my code to run with latest build, but finally was able to do so. <br>
<br>I had to make following additions:<br><br></div>inside open_audio_input():<br><br> // Set up SWR context once you've got codec information<br> swr = swr_alloc();<br> av_opt_set_int(swr, "in_channel_layout", codec_ctx_audio->channel_layout, 0);<br>
av_opt_set_int(swr, "out_channel_layout", codec_ctx_audio->channel_layout, 0);<br> av_opt_set_int(swr, "in_sample_rate", codec_ctx_audio->sample_rate, 0);<br> av_opt_set_int(swr, "out_sample_rate", codec_ctx_audio->sample_rate, 0);<br>
av_opt_set_sample_fmt(swr, "in_sample_fmt", AV_SAMPLE_FMT_S16P, 0);<br> av_opt_set_sample_fmt(swr, "out_sample_fmt", AV_SAMPLE_FMT_S16, 0);<br> swr_init(swr);<br><br></div>inside decode_packet():<br>
<br> swr_convert( swr, audio_dst_data, decoded_frame->nb_samples, (const uint8_t**) decoded_frame->extended_data, decoded_frame->nb_samples );<br><br></div>inside add_audio_stream():<br><br> c->sample_fmt = AV_SAMPLE_FMT_S16;<br>
c->bit_rate = audio_bit_rate;<br> c->sample_rate = audio_sample_rate;<br> c->channels = audio_channels;<br><br></div>Then, all things started working, but the output was identical to previous behavior (plays faster, and ends on same time: on about 65th second).<br>
<br></div>I tried changing output format from AV_SAMPLE_FMT_S16 to AV_SAMPLE_FMT_FLTP (inside above relevant functions), but it fails inside avcodec_open2(), giving me -22 return value.<br><br></div>Any ideas how to fix this?<br>
<br>Thanks for your time...<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 24, 2013 at 11:26 AM, Taha Ansari <span dir="ltr"><<a href="mailto:mtaha.ansari@gmail.com" target="_blank">mtaha.ansari@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi Carl,<br><br></div>You are right, last working build I downloaded from <span>Zeranoe FFmpeg builds was from a long time ago. If you suggest I can always get the latest working build from there, but! the point is: even for this old version of FFmpeg, command line "ffmpeg.exe -i test.mp3 test.mp4" converts the file just fine, so there is obviously something wrong with my code...<br>
<br></span></div><span>Still, if you suggest I get latest build from there, well, I can do it as well!<br><br>Kindly, could you guide further based on above facts?<br></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">
On Mon, Jun 24, 2013 at 11:04 AM, Carl Eugen Hoyos <span dir="ltr"><<a href="mailto:cehoyos@ag.or.at" target="_blank">cehoyos@ag.or.at</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Taha Ansari <mtaha.ansari@...> writes:<br>
<br>
> ffprobe version N-47062-g26c531c Copyright (c) 2007-2012<br>
<br>
</div>This looks outdated.<br>
The aac decoder of current git head outputs FLTP iirc.<br>
<div><div><br>
Carl Eugen<br>
<br>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">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>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>