Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
ffmpeg-doc / usr / share / doc / ffmpeg-doc / api / group__lavc__encoding.html
Size: Mime:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>FFmpeg: Encoding</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">FFmpeg
   &#160;<span id="projectnumber">2.7.1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Encoding</div>  </div>
<div class="ingroups"><a class="el" href="group__libavc.html">Encoding/Decoding Library</a></div></div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structRcOverride.html">RcOverride</a></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__encoding.html#gacf94eb890b3b77383ec7fd728db8509c">FF_MIN_BUFFER_SIZE</a>&#160;&#160;&#160;16384</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">minimum encoding buffer size Used to avoid some checks during header writing.  <a href="#gacf94eb890b3b77383ec7fd728db8509c"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__encoding.html#ga09b261f1bce5161af3485cb3302edd27">Motion_Est_ID</a> { <br/>
&#160;&#160;<a class="el" href="group__lavc__encoding.html#gga09b261f1bce5161af3485cb3302edd27a93dc3282c22808d298c81bfde3882c42">ME_ZERO</a> =  1, 
<a class="el" href="group__lavc__encoding.html#gga09b261f1bce5161af3485cb3302edd27a84208f4e6c361aaf87ac0c0f71116431">ME_FULL</a>, 
<a class="el" href="group__lavc__encoding.html#gga09b261f1bce5161af3485cb3302edd27a712da9e85272e6bc8d73d897e40e8ab8">ME_LOG</a>, 
<a class="el" href="group__lavc__encoding.html#gga09b261f1bce5161af3485cb3302edd27ab9f980e93b9500d67b1308ad0e9ce72a">ME_PHODS</a>, 
<br/>
&#160;&#160;<a class="el" href="group__lavc__encoding.html#gga09b261f1bce5161af3485cb3302edd27a47a2cf1ba9719d733ff2c0c0fc6e3491">ME_EPZS</a>, 
<a class="el" href="group__lavc__encoding.html#gga09b261f1bce5161af3485cb3302edd27a97220d3da7ac127439d96e641b48ca5f">ME_X1</a>, 
<a class="el" href="group__lavc__encoding.html#gga09b261f1bce5161af3485cb3302edd27a842aadc9a6d4f1c9fa20a17c77521327">ME_HEX</a>, 
<a class="el" href="group__lavc__encoding.html#gga09b261f1bce5161af3485cb3302edd27a933a98fe54bd38c7ba77ca9a917e3bc8">ME_UMH</a>, 
<br/>
&#160;&#160;<a class="el" href="group__lavc__encoding.html#gga09b261f1bce5161af3485cb3302edd27ad0718ff68dd2d8f9642f5ca4aab1e181">ME_TESA</a>, 
<a class="el" href="group__lavc__encoding.html#gga09b261f1bce5161af3485cb3302edd27ab2b41a1b4640728bd95c1910b111270f">ME_ITER</a> = 50
<br/>
 }</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">motion estimation type.  <a href="group__lavc__encoding.html#ga09b261f1bce5161af3485cb3302edd27">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structAVCodec.html">AVCodec</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__encoding.html#ga9f820c481615c3a02d0407bac0bdbf25">avcodec_find_encoder</a> (enum <a class="el" href="group__lavc__core.html#gaadca229ad2c20e060a14fec08a5cc7ce">AVCodecID</a> id)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Find a registered encoder with a matching codec ID.  <a href="#ga9f820c481615c3a02d0407bac0bdbf25"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structAVCodec.html">AVCodec</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__encoding.html#gaa614ffc38511c104bdff4a3afa086d37">avcodec_find_encoder_by_name</a> (const char *name)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Find a registered encoder with the specified name.  <a href="#gaa614ffc38511c104bdff4a3afa086d37"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int <a class="el" href="attributes_8h.html#aa6d076561d3a9eea4729ee632652de02">attribute_deprecated</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__encoding.html#gaf12a9da0d33f50ff406e03572fab4763">avcodec_encode_audio</a> (<a class="el" href="structAVCodecContext.html">AVCodecContext</a> *avctx, uint8_t *buf, int buf_size, const short *samples)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Encode an audio frame from samples into buf.  <a href="#gaf12a9da0d33f50ff406e03572fab4763"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__encoding.html#ga93a49fbd0973b216dcb8a8c5dffe1d82">avcodec_encode_audio2</a> (<a class="el" href="structAVCodecContext.html">AVCodecContext</a> *avctx, <a class="el" href="structAVPacket.html">AVPacket</a> *avpkt, const <a class="el" href="structAVFrame.html">AVFrame</a> *<a class="el" href="extract__mvs_8c.html#ad7d33d579a8d4241a5e643e39287a209">frame</a>, int *got_packet_ptr)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Encode a frame of audio.  <a href="#ga93a49fbd0973b216dcb8a8c5dffe1d82"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="attributes_8h.html#aa6d076561d3a9eea4729ee632652de02">attribute_deprecated</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__encoding.html#ga22847c21918ee93a4d05f7ffb419f9a9">avcodec_encode_video</a> (<a class="el" href="structAVCodecContext.html">AVCodecContext</a> *avctx, uint8_t *buf, int buf_size, const <a class="el" href="structAVFrame.html">AVFrame</a> *pict)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__encoding.html#gaa2dc9e9ea2567ebb2801a08153c7306b">avcodec_encode_video2</a> (<a class="el" href="structAVCodecContext.html">AVCodecContext</a> *avctx, <a class="el" href="structAVPacket.html">AVPacket</a> *avpkt, const <a class="el" href="structAVFrame.html">AVFrame</a> *<a class="el" href="extract__mvs_8c.html#ad7d33d579a8d4241a5e643e39287a209">frame</a>, int *got_packet_ptr)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Encode a frame of video.  <a href="#gaa2dc9e9ea2567ebb2801a08153c7306b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__encoding.html#ga37be256d85d78f665df27ad6c8f1d65b">avcodec_encode_subtitle</a> (<a class="el" href="structAVCodecContext.html">AVCodecContext</a> *avctx, uint8_t *buf, int buf_size, const <a class="el" href="structAVSubtitle.html">AVSubtitle</a> *sub)</td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="gacf94eb890b3b77383ec7fd728db8509c"></a><!-- doxytag: member="avcodec.h::FF_MIN_BUFFER_SIZE" ref="gacf94eb890b3b77383ec7fd728db8509c" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="group__lavc__encoding.html#gacf94eb890b3b77383ec7fd728db8509c">FF_MIN_BUFFER_SIZE</a>&#160;&#160;&#160;16384</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>minimum encoding buffer size Used to avoid some checks during header writing. </p>

<p>Definition at line <a class="el" href="libavcodec_2avcodec_8h_source.html#l00637">637</a> of file <a class="el" href="libavcodec_2avcodec_8h_source.html">avcodec.h</a>.</p>

</div>
</div>
<hr/><h2>Enumeration Type Documentation</h2>
<a class="anchor" id="ga09b261f1bce5161af3485cb3302edd27"></a><!-- doxytag: member="avcodec.h::Motion_Est_ID" ref="ga09b261f1bce5161af3485cb3302edd27" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__lavc__encoding.html#ga09b261f1bce5161af3485cb3302edd27">Motion_Est_ID</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>motion estimation type. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="gga09b261f1bce5161af3485cb3302edd27a93dc3282c22808d298c81bfde3882c42"></a><!-- doxytag: member="ME_ZERO" ref="gga09b261f1bce5161af3485cb3302edd27a93dc3282c22808d298c81bfde3882c42" args="" -->ME_ZERO</em>&nbsp;</td><td>
<p>no search, that is use 0,0 vector whenever one is needed </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga09b261f1bce5161af3485cb3302edd27a84208f4e6c361aaf87ac0c0f71116431"></a><!-- doxytag: member="ME_FULL" ref="gga09b261f1bce5161af3485cb3302edd27a84208f4e6c361aaf87ac0c0f71116431" args="" -->ME_FULL</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga09b261f1bce5161af3485cb3302edd27a712da9e85272e6bc8d73d897e40e8ab8"></a><!-- doxytag: member="ME_LOG" ref="gga09b261f1bce5161af3485cb3302edd27a712da9e85272e6bc8d73d897e40e8ab8" args="" -->ME_LOG</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga09b261f1bce5161af3485cb3302edd27ab9f980e93b9500d67b1308ad0e9ce72a"></a><!-- doxytag: member="ME_PHODS" ref="gga09b261f1bce5161af3485cb3302edd27ab9f980e93b9500d67b1308ad0e9ce72a" args="" -->ME_PHODS</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga09b261f1bce5161af3485cb3302edd27a47a2cf1ba9719d733ff2c0c0fc6e3491"></a><!-- doxytag: member="ME_EPZS" ref="gga09b261f1bce5161af3485cb3302edd27a47a2cf1ba9719d733ff2c0c0fc6e3491" args="" -->ME_EPZS</em>&nbsp;</td><td>
<p>enhanced predictive zonal search </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga09b261f1bce5161af3485cb3302edd27a97220d3da7ac127439d96e641b48ca5f"></a><!-- doxytag: member="ME_X1" ref="gga09b261f1bce5161af3485cb3302edd27a97220d3da7ac127439d96e641b48ca5f" args="" -->ME_X1</em>&nbsp;</td><td>
<p>reserved for experiments </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga09b261f1bce5161af3485cb3302edd27a842aadc9a6d4f1c9fa20a17c77521327"></a><!-- doxytag: member="ME_HEX" ref="gga09b261f1bce5161af3485cb3302edd27a842aadc9a6d4f1c9fa20a17c77521327" args="" -->ME_HEX</em>&nbsp;</td><td>
<p>hexagon based search </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga09b261f1bce5161af3485cb3302edd27a933a98fe54bd38c7ba77ca9a917e3bc8"></a><!-- doxytag: member="ME_UMH" ref="gga09b261f1bce5161af3485cb3302edd27a933a98fe54bd38c7ba77ca9a917e3bc8" args="" -->ME_UMH</em>&nbsp;</td><td>
<p>uneven multi-hexagon search </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga09b261f1bce5161af3485cb3302edd27ad0718ff68dd2d8f9642f5ca4aab1e181"></a><!-- doxytag: member="ME_TESA" ref="gga09b261f1bce5161af3485cb3302edd27ad0718ff68dd2d8f9642f5ca4aab1e181" args="" -->ME_TESA</em>&nbsp;</td><td>
<p>transformed exhaustive search algorithm </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga09b261f1bce5161af3485cb3302edd27ab2b41a1b4640728bd95c1910b111270f"></a><!-- doxytag: member="ME_ITER" ref="gga09b261f1bce5161af3485cb3302edd27ab2b41a1b4640728bd95c1910b111270f" args="" -->ME_ITER</em>&nbsp;</td><td>
<p>iterative search </p>
</td></tr>
</table>
</dd>
</dl>

<p>Definition at line <a class="el" href="libavcodec_2avcodec_8h_source.html#l00644">644</a> of file <a class="el" href="libavcodec_2avcodec_8h_source.html">avcodec.h</a>.</p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga9f820c481615c3a02d0407bac0bdbf25"></a><!-- doxytag: member="avcodec.h::avcodec_find_encoder" ref="ga9f820c481615c3a02d0407bac0bdbf25" args="(enum AVCodecID id)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structAVCodec.html">AVCodec</a>* <a class="el" href="group__lavc__encoding.html#ga9f820c481615c3a02d0407bac0bdbf25">avcodec_find_encoder</a> </td>
          <td>(</td>
          <td class="paramtype">enum <a class="el" href="group__lavc__core.html#gaadca229ad2c20e060a14fec08a5cc7ce">AVCodecID</a>&#160;</td>
          <td class="paramname"><em>id</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Find a registered encoder with a matching codec ID. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">id</td><td>AVCodecID of the requested encoder </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An encoder if one was found, NULL otherwise. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="decoding_encoding_8c-example.html#a17">decoding_encoding.c</a>, <a class="el" href="muxing_8c-example.html#a34">muxing.c</a>, <a class="el" href="transcode_aac_8c-example.html#a22">transcode_aac.c</a>, and <a class="el" href="transcoding_8c-example.html#a33">transcoding.c</a>.</dd>
</dl>
<p>Referenced by <a class="el" href="muxing_8c_source.html#l00092">add_stream()</a>, <a class="el" href="decoding__encoding_8c_source.html#l00103">audio_encode_example()</a>, <a class="el" href="transcode__aac_8c_source.html#l00120">open_output_file()</a>, and <a class="el" href="decoding__encoding_8c_source.html#l00347">video_encode_example()</a>.</p>

</div>
</div>
<a class="anchor" id="gaa614ffc38511c104bdff4a3afa086d37"></a><!-- doxytag: member="avcodec.h::avcodec_find_encoder_by_name" ref="gaa614ffc38511c104bdff4a3afa086d37" args="(const char *name)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structAVCodec.html">AVCodec</a>* <a class="el" href="group__lavc__encoding.html#gaa614ffc38511c104bdff4a3afa086d37">avcodec_find_encoder_by_name</a> </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Find a registered encoder with the specified name. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>name of the requested encoder </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An encoder if one was found, NULL otherwise. </dd></dl>

</div>
</div>
<a class="anchor" id="gaf12a9da0d33f50ff406e03572fab4763"></a><!-- doxytag: member="avcodec.h::avcodec_encode_audio" ref="gaf12a9da0d33f50ff406e03572fab4763" args="(AVCodecContext *avctx, uint8_t *buf, int buf_size, const short *samples)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="attributes_8h.html#aa6d076561d3a9eea4729ee632652de02">attribute_deprecated</a> <a class="el" href="group__lavc__encoding.html#gaf12a9da0d33f50ff406e03572fab4763">avcodec_encode_audio</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structAVCodecContext.html">AVCodecContext</a> *&#160;</td>
          <td class="paramname"><em>avctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>buf_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const short *&#160;</td>
          <td class="paramname"><em>samples</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Encode an audio frame from samples into buf. </p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000018">Deprecated:</a></b></dt><dd>Use avcodec_encode_audio2 instead.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large. However, for codecs with avctx-&gt;frame_size equal to 0 (e.g. PCM) the user will know how much space is needed because it depends on the value passed in buf_size as described below. In that case a lower value can be used.</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir"></td><td class="paramname">avctx</td><td>the codec context </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">buf</td><td>the output buffer </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">buf_size</td><td>the output buffer size </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">samples</td><td>the input buffer containing the samples The number of samples read from this buffer is frame_size*channels, both of which are defined in avctx. For codecs which have avctx-&gt;frame_size equal to 0 (e.g. PCM) the number of samples read from samples is equal to: buf_size * 8 / (avctx-&gt;channels * av_get_bits_per_sample(avctx-&gt;codec_id)) This also implies that <a class="el" href="group__lavc__misc.html#ga0717e7440fdb123f708082f66cd9b41d" title="Return codec bits per sample.">av_get_bits_per_sample()</a> must not return 0 for these codecs. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>On error a negative value is returned, on success zero or the number of bytes used to encode the data read from the input buffer. </dd></dl>

</div>
</div>
<a class="anchor" id="ga93a49fbd0973b216dcb8a8c5dffe1d82"></a><!-- doxytag: member="avcodec.h::avcodec_encode_audio2" ref="ga93a49fbd0973b216dcb8a8c5dffe1d82" args="(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group__lavc__encoding.html#ga93a49fbd0973b216dcb8a8c5dffe1d82">avcodec_encode_audio2</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structAVCodecContext.html">AVCodecContext</a> *&#160;</td>
          <td class="paramname"><em>avctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structAVPacket.html">AVPacket</a> *&#160;</td>
          <td class="paramname"><em>avpkt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structAVFrame.html">AVFrame</a> *&#160;</td>
          <td class="paramname"><em>frame</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>got_packet_ptr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Encode a frame of audio. </p>
<p>Takes input samples from frame and writes the next output packet, if available, to avpkt. The output packet does not necessarily contain data for the most recent frame, as encoders can delay, split, and combine input frames internally as needed.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">avctx</td><td>codec context </td></tr>
    <tr><td class="paramname">avpkt</td><td>output <a class="el" href="structAVPacket.html" title="This structure stores compressed data.">AVPacket</a>. The user can supply an output buffer by setting avpkt-&gt;data and avpkt-&gt;size prior to calling the function, but if the size of the user-provided data is not large enough, encoding will fail. If avpkt-&gt;data and avpkt-&gt;size are set, avpkt-&gt;destruct must also be set. All other <a class="el" href="structAVPacket.html" title="This structure stores compressed data.">AVPacket</a> fields will be reset by the encoder using <a class="el" href="group__lavc__packet.html#gac9cb9756175b96e7441575803757fb73" title="Initialize optional fields of a packet with default values.">av_init_packet()</a>. If avpkt-&gt;data is NULL, the encoder will allocate it. The encoder will set avpkt-&gt;size to the size of the output packet.</td></tr>
  </table>
  </dd>
</dl>
<p>If this function fails or produces no output, avpkt will be freed using <a class="el" href="group__lavc__packet.html#gae65881462e78f98b268f34661d921ee0" title="Free a packet.">av_free_packet()</a> (i.e. avpkt-&gt;destruct will be called to free the user supplied buffer). </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">frame</td><td><a class="el" href="structAVFrame.html" title="This structure describes decoded (raw) audio or video data.">AVFrame</a> containing the raw audio data to be encoded. May be NULL when flushing an encoder that has the CODEC_CAP_DELAY capability set. If CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame can have any number of samples. If it is not set, frame-&gt;nb_samples must be equal to avctx-&gt;frame_size for all frames except the last. The final frame may be smaller than avctx-&gt;frame_size. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">got_packet_ptr</td><td>This field is set to 1 by libavcodec if the output packet is non-empty, and to 0 if it is empty. If the function returns an error, the packet can be assumed to be invalid, and the value of got_packet_ptr is undefined and should not be used. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, negative error code on failure </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="decoding_encoding_8c-example.html#a38">decoding_encoding.c</a>, <a class="el" href="muxing_8c-example.html#a103">muxing.c</a>, <a class="el" href="transcode_aac_8c-example.html#a82">transcode_aac.c</a>, and <a class="el" href="transcoding_8c-example.html#a92">transcoding.c</a>.</dd>
</dl>
<p>Referenced by <a class="el" href="decoding__encoding_8c_source.html#l00103">audio_encode_example()</a>, <a class="el" href="transcode__aac_8c_source.html#l00550">encode_audio_frame()</a>, and <a class="el" href="transcoding_8c_source.html#l00366">encode_write_frame()</a>.</p>

</div>
</div>
<a class="anchor" id="ga22847c21918ee93a4d05f7ffb419f9a9"></a><!-- doxytag: member="avcodec.h::avcodec_encode_video" ref="ga22847c21918ee93a4d05f7ffb419f9a9" args="(AVCodecContext *avctx, uint8_t *buf, int buf_size, const AVFrame *pict)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="attributes_8h.html#aa6d076561d3a9eea4729ee632652de02">attribute_deprecated</a> int <a class="el" href="group__lavc__encoding.html#ga22847c21918ee93a4d05f7ffb419f9a9">avcodec_encode_video</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structAVCodecContext.html">AVCodecContext</a> *&#160;</td>
          <td class="paramname"><em>avctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>buf_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structAVFrame.html">AVFrame</a> *&#160;</td>
          <td class="paramname"><em>pict</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000019">Deprecated:</a></b></dt><dd>use <a class="el" href="group__lavc__encoding.html#gaa2dc9e9ea2567ebb2801a08153c7306b" title="Encode a frame of video.">avcodec_encode_video2()</a> instead.</dd></dl>
<p>Encode a video frame from pict into buf. The input picture should be stored using a specific format, namely avctx.pix_fmt.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir"></td><td class="paramname">avctx</td><td>the codec context </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">buf</td><td>the output buffer for the bitstream of encoded frame </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">buf_size</td><td>the size of the output buffer in bytes </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">pict</td><td>the input picture to encode </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>On error a negative value is returned, on success zero or the number of bytes used from the output buffer. </dd></dl>

</div>
</div>
<a class="anchor" id="gaa2dc9e9ea2567ebb2801a08153c7306b"></a><!-- doxytag: member="avcodec.h::avcodec_encode_video2" ref="gaa2dc9e9ea2567ebb2801a08153c7306b" args="(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group__lavc__encoding.html#gaa2dc9e9ea2567ebb2801a08153c7306b">avcodec_encode_video2</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structAVCodecContext.html">AVCodecContext</a> *&#160;</td>
          <td class="paramname"><em>avctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structAVPacket.html">AVPacket</a> *&#160;</td>
          <td class="paramname"><em>avpkt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structAVFrame.html">AVFrame</a> *&#160;</td>
          <td class="paramname"><em>frame</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>got_packet_ptr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Encode a frame of video. </p>
<p>Takes input raw video data from frame and writes the next output packet, if available, to avpkt. The output packet does not necessarily contain data for the most recent frame, as encoders can delay and reorder input frames internally as needed.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">avctx</td><td>codec context </td></tr>
    <tr><td class="paramname">avpkt</td><td>output <a class="el" href="structAVPacket.html" title="This structure stores compressed data.">AVPacket</a>. The user can supply an output buffer by setting avpkt-&gt;data and avpkt-&gt;size prior to calling the function, but if the size of the user-provided data is not large enough, encoding will fail. All other <a class="el" href="structAVPacket.html" title="This structure stores compressed data.">AVPacket</a> fields will be reset by the encoder using <a class="el" href="group__lavc__packet.html#gac9cb9756175b96e7441575803757fb73" title="Initialize optional fields of a packet with default values.">av_init_packet()</a>. If avpkt-&gt;data is NULL, the encoder will allocate it. The encoder will set avpkt-&gt;size to the size of the output packet. The returned data (if any) belongs to the caller, he is responsible for freeing it.</td></tr>
  </table>
  </dd>
</dl>
<p>If this function fails or produces no output, avpkt will be freed using <a class="el" href="group__lavc__packet.html#gae65881462e78f98b268f34661d921ee0" title="Free a packet.">av_free_packet()</a> (i.e. avpkt-&gt;destruct will be called to free the user supplied buffer). </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">frame</td><td><a class="el" href="structAVFrame.html" title="This structure describes decoded (raw) audio or video data.">AVFrame</a> containing the raw video data to be encoded. May be NULL when flushing an encoder that has the CODEC_CAP_DELAY capability set. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">got_packet_ptr</td><td>This field is set to 1 by libavcodec if the output packet is non-empty, and to 0 if it is empty. If the function returns an error, the packet can be assumed to be invalid, and the value of got_packet_ptr is undefined and should not be used. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, negative error code on failure </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="decoding_encoding_8c-example.html#a72">decoding_encoding.c</a>, <a class="el" href="muxing_8c-example.html#a125">muxing.c</a>, and <a class="el" href="transcoding_8c-example.html#a91">transcoding.c</a>.</dd>
</dl>
<p>Referenced by <a class="el" href="transcoding_8c_source.html#l00366">encode_write_frame()</a>, <a class="el" href="decoding__encoding_8c_source.html#l00347">video_encode_example()</a>, and <a class="el" href="muxing_8c_source.html#l00490">write_video_frame()</a>.</p>

</div>
</div>
<a class="anchor" id="ga37be256d85d78f665df27ad6c8f1d65b"></a><!-- doxytag: member="avcodec.h::avcodec_encode_subtitle" ref="ga37be256d85d78f665df27ad6c8f1d65b" args="(AVCodecContext *avctx, uint8_t *buf, int buf_size, const AVSubtitle *sub)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group__lavc__encoding.html#ga37be256d85d78f665df27ad6c8f1d65b">avcodec_encode_subtitle</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structAVCodecContext.html">AVCodecContext</a> *&#160;</td>
          <td class="paramname"><em>avctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>buf_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structAVSubtitle.html">AVSubtitle</a> *&#160;</td>
          <td class="paramname"><em>sub</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
</div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>