<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_1_1490655411959_13512"><span style="font-family: Arial; font-size: small;" id="yui_3_16_0_1_1490655411959_14133">Il Lunedì 27 Marzo 2017 10:05, Carl Eugen Hoyos <ceffmpeg@gmail.com> ha scritto:</span><br></div><div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" id="yui_3_16_0_1_1490655411959_13507" style="display: block;"><div id="yui_3_16_0_1_1490655411959_13506"><div id="yui_3_16_0_1_1490655411959_13505">  <br><br> <div class="y_msg_container" id="yui_3_16_0_1_1490655411959_13504" style="font-size: 16px; font-family: HelveticaNeue, "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;"><div dir="ltr" id="yui_3_16_0_1_1490655411959_13503">2017-03-27 9:11 GMT+02:00 Gabor Alsecz <<a shape="rect" ymailto="mailto:alseczg@gmail.com" href="mailto:alseczg@gmail.com" id="yui_3_16_0_1_1490655411959_13511">alseczg@gmail.com</a>>:<br clear="none"><br clear="none">> Thanks for the code snippet you have pasted here. Many of us<br clear="none">> struggling here because lack of samples even based on the latest API.<br clear="none">> I just can confirm to the Libav team we really would need new API<br clear="none">> examples and please try to figure out the way how Paolo can share<br clear="none">> his snippets commonly.<br clear="none"><br clear="none">(Speaking for FFmpeg, not any forks)<br clear="none">If the snippets provide advantages over the code in doc/examples,<br clear="none">please send your patch (against current FFmpeg git head) made<br clear="none">with git format-patch to the FFmpeg development mailing list.<br clear="none">This is also where the feedback comes from.<br clear="none"><br clear="none">Carl Eugen<div class="yqt9133301484" id="yqtfd36408"><br clear="none">_______________________________________________<br clear="none">Libav-user mailing list<br clear="none"><a shape="rect" ymailto="mailto:Libav-user@ffmpeg.org" href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br clear="none"><a shape="rect" href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank" id="yui_3_16_0_1_1490655411959_16279">http://ffmpeg.org/mailman/listinfo/libav-user</a><br clear="none"></div></div><br><br></div><div class="y_msg_container" id="yui_3_16_0_1_1490655411959_13504" style="font-size: 16px; font-family: HelveticaNeue, "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;"><br></div><div class="y_msg_container" id="yui_3_16_0_1_1490655411959_13504" style="font-size: 16px; font-family: HelveticaNeue, "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;"><br></div><div class="y_msg_container" id="yui_3_16_0_1_1490655411959_13504" style="font-size: 16px; font-family: HelveticaNeue, "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;"><br id="yui_3_16_0_1_1490655411959_16658"></div><div class="y_msg_container" id="yui_3_16_0_1_1490655411959_13504"><div tabindex="0" style="outline: none 0px; display: table; width: 1333px; box-sizing: border-box; padding-top: 12px; padding-left: 0px; font-family: "Helvetica Neue", "Segoe UI", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 13px;" id="yui_3_16_0_1_1490655411959_13657"><div style="display: table-cell; width: auto; word-wrap: break-word; word-break: break-word;" id="yui_3_16_0_1_1490655411959_13658"><div id="yui_3_16_0_1_1490655411959_13659"><div id="yui_3_16_0_1_1490655411959_13660"><font face="Courier New, courier, monaco, monospace, sans-serif" id="yui_3_16_0_1_1490655411959_13839" size="3">Hello,</font></div><div id="yui_3_16_0_1_1490655411959_13661"><font face="Courier New, courier, monaco, monospace, sans-serif" size="3"><br id="yui_3_16_0_1_1490655411959_13662"></font></div><div id="yui_3_16_0_1_1490655411959_13663"><font face="Courier New, courier, monaco, monospace, sans-serif" id="yui_3_16_0_1_1490655411959_13830" size="3">The snippet I posted could provide these advantages:</font></div><div id="yui_3_16_0_1_1490655411959_13664"><font face="Courier New, courier, monaco, monospace, sans-serif" size="3"><br id="yui_3_16_0_1_1490655411959_13665"></font></div><div id="yui_3_16_0_1_1490655411959_13666" dir="ltr"><font face="Courier New, courier, monaco, monospace, sans-serif" id="yui_3_16_0_1_1490655411959_13829" size="3">1) it can easily be adapted to any audio input source (i.e: a live source)</font></div><div id="yui_3_16_0_1_1490655411959_13667"><font face="Courier New, courier, monaco, monospace, sans-serif" size="3"><br id="yui_3_16_0_1_1490655411959_13668"></font></div><div id="yui_3_16_0_1_1490655411959_13669"><font face="Courier New, courier, monaco, monospace, sans-serif" id="yui_3_16_0_1_1490655411959_13828" size="3">2) it is short and written in a strict procedural way, without using any function which splits the code with the result of forcing the reader/user to jump from a line to another one in order to understand in details what's happening.</font></div><div id="yui_3_16_0_1_1490655411959_13670"><font face="Courier New, courier, monaco, monospace, sans-serif" size="3"><br id="yui_3_16_0_1_1490655411959_13671"></font></div><div id="yui_3_16_0_1_1490655411959_13672"><font face="Courier New, courier, monaco, monospace, sans-serif" id="yui_3_16_0_1_1490655411959_13818" size="3">3) all the tasks are separated and all of them are exposed to the user without using functions which hide internal tasks/containers; i.e: muxed data is stored in memory and exposed through a callback function. Therefore, the user can pick specific portions of the code (input raw frame, resampled frame, encoded packet and muxed data) and adapt them to his needings.</font></div><div id="yui_3_16_0_1_1490655411959_13673"><font face="Courier New, courier, monaco, monospace, sans-serif" size="3"><br id="yui_3_16_0_1_1490655411959_13674"></font></div><div id="yui_3_16_0_1_1490655411959_13675"><font id="yui_3_16_0_1_1490655411959_13805" face="Courier New, courier, monaco, monospace, sans-serif" size="3">4) it can be easily adapted to other audio codecs: I used the aac one, in the example, because it requires a container (adts), then it improves the basic knowledge of the API; but the user can adapt the snippet to mp2 codec, for example, by simply removing the container part, and he can directly write to file the encoded packets.</font></div><div id="yui_3_16_0_1_1490655411959_13676"><font face="Courier New, courier, monaco, monospace, sans-serif" size="3"><br id="yui_3_16_0_1_1490655411959_13677"></font></div><div dir="ltr" id="yui_3_16_0_1_1490655411959_13678"><font id="yui_3_16_0_1_1490655411959_13808" face="Courier New, courier, monaco, monospace, sans-serif" size="3">5) The cleanup stuff is divided into steps.</font></div><div dir="ltr" id="yui_3_16_0_1_1490655411959_13678"><font face="Courier New, courier, monaco, monospace, sans-serif" size="3"><br></font></div><div dir="ltr" id="yui_3_16_0_1_1490655411959_13678"><br></div><div dir="ltr" id="yui_3_16_0_1_1490655411959_13678"><font face="Courier New, courier, monaco, monospace, sans-serif" size="3" id="yui_3_16_0_1_1490655411959_14122">This message is cross-posted to the ffmpeg-devel mailing list and includes the previous snippet in form of patches in git format-patch (Makefile and snippet files). If it will be accepted, I can provide the next example, which covers h264 encoding, muxing and streaming.</font></div></div></div></div><div style="font-size: 16px; font-family: HelveticaNeue, "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; margin-top: 0.1em; margin-bottom: 0.1em;" id="yui_3_16_0_1_1490655411959_13679"><br id="yui_3_16_0_1_1490655411959_13680"></div><div style="font-size: 16px; font-family: HelveticaNeue, "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr" id="yui_3_16_0_1_1490655411959_13681"><br id="yui_3_16_0_1_1490655411959_13682"></div></div><div class="y_msg_container" id="yui_3_16_0_1_1490655411959_13504" style="font-size: 16px; font-family: HelveticaNeue, "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;"><br></div><div class="y_msg_container" id="yui_3_16_0_1_1490655411959_13504" style="font-size: 16px; font-family: HelveticaNeue, "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;"><br></div>  </div> </div>  </div></div></body></html>