<font color='black' size='2' face='arial'>
<div style="font-family:arial,helvetica;font-size:10pt;color:black"><br>
From: Taha Ansari <mtaha.ansari@gmail.com><br>
To: This list is about using libavcodec, libavformat, libavutil, libavdevice
<br>
 and libavfilter. <libav-user@ffmpeg.org><br>
Sent: Sat, Dec 7, 2013 6:00 am<br>
Subject: Re: [Libav-user] Converting from AV_SAMPLE_FMT_FLTP to AV_SAMPLE_FMT_FLT<br>
<br>




<div id="AOLMsgPart_2_c91a6cad-643f-4041-8504-ef8773930a85">

<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">On Fri, Dec 6, 2013 at 6:21 AM, Alexandru Rosca <span dir="ltr"><<a href="mailto:srosca@bu.edu">srosca@bu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<div dir="ltr">I am decoding audio and trying to convert it from the planar format to just FLT (packed?). I am making a library which when used will return the buffer with the data. I am using swr_convert but if I pass it frame.extended_data, it crashes.</div>

</blockquote>
<div><br>
</div>

<div>Yes, swr_convert functions should be able to do this without any problem.<br>
</div>

<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<div dir="ltr"> If I just pass it frame.data[0] I get really crackly audio on the other end. I suspect the problem is converting between these formats? Setting request_sample_fmt to av_sample_flt doesnt work.</div>


<br>
</blockquote>
<div><br>
</div>

<div>You might want to share some workable sample code, otherwise it is pure guessing.<br>
</div>

<div><br>
</div>

<div><br>
</div>

<div> >>>>>>></div>

<div><br>
</div>

<div>I do not use sws_convert to do this because there is no real conversion necessary, just copying.   Since I have to copy data from frame.data[] anyway, I do a simple copy for non planar format. But with planar format, channel 1's samples are in frame.data[0] and channel 2's samples are in frame.data[1].  You just need to copy the 4-byte samples from the two buffers to your single output buffer interleaved, i.e., channel 1 - sample 0, channel 2 - sample 0, channel 1 - sample 1, channel 2 - sample 1, ...</div>

<div><br>
</div>

<div>-Felix</div>

<div><br>
</div>

<div><br>
</div>

<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
_______________________________________________<br>

Libav-user mailing list<br>

<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>

<a target="_blank" href="http://ffmpeg.org/mailman/listinfo/libav-user">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>

<br>
</blockquote></div>
<br>
</div>
</div>


</div>



<div id="AOLMsgPart_3_c91a6cad-643f-4041-8504-ef8773930a85" style="margin: 0px;font-family: Tahoma, Verdana, Arial, Sans-Serif;font-size: 12px;color: #000;background-color: #fff;">

<pre style="font-size: 9pt;"><tt>_______________________________________________
Libav-user mailing list
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a>
</tt></pre>
</div>
 <!-- end of AOLMsgPart_3_c91a6cad-643f-4041-8504-ef8773930a85 -->



</div>
</font>