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 / 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"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>FFmpeg: Encoding</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<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">3.0.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<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><!-- top -->
<!-- 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>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</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>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Encoding<div class="ingroups"><a class="el" href="group__libavc.html">Encoding/Decoding Library</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><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 class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga4fde50e2cad4cf3d66d882a7078aeab4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__encoding.html#ga4fde50e2cad4cf3d66d882a7078aeab4">AV_INPUT_BUFFER_MIN_SIZE</a>&#160;&#160;&#160;16384</td></tr>
<tr class="memdesc:ga4fde50e2cad4cf3d66d882a7078aeab4"><td class="mdescLeft">&#160;</td><td class="mdescRight">minimum encoding buffer size Used to avoid some checks during header writing.  <a href="#ga4fde50e2cad4cf3d66d882a7078aeab4">More...</a><br/></td></tr>
<tr class="separator:ga4fde50e2cad4cf3d66d882a7078aeab4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga09b261f1bce5161af3485cb3302edd27"><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 class="memdesc:ga09b261f1bce5161af3485cb3302edd27"><td class="mdescLeft">&#160;</td><td class="mdescRight">motion estimation type.  <a href="group__lavc__encoding.html#ga09b261f1bce5161af3485cb3302edd27">More...</a><br/></td></tr>
<tr class="separator:ga09b261f1bce5161af3485cb3302edd27"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga9f820c481615c3a02d0407bac0bdbf25"><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 class="memdesc:ga9f820c481615c3a02d0407bac0bdbf25"><td class="mdescLeft">&#160;</td><td class="mdescRight">Find a registered encoder with a matching codec ID.  <a href="#ga9f820c481615c3a02d0407bac0bdbf25">More...</a><br/></td></tr>
<tr class="separator:ga9f820c481615c3a02d0407bac0bdbf25"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa614ffc38511c104bdff4a3afa086d37"><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 class="memdesc:gaa614ffc38511c104bdff4a3afa086d37"><td class="mdescLeft">&#160;</td><td class="mdescRight">Find a registered encoder with the specified name.  <a href="#gaa614ffc38511c104bdff4a3afa086d37">More...</a><br/></td></tr>
<tr class="separator:gaa614ffc38511c104bdff4a3afa086d37"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga93a49fbd0973b216dcb8a8c5dffe1d82"><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 class="memdesc:ga93a49fbd0973b216dcb8a8c5dffe1d82"><td class="mdescLeft">&#160;</td><td class="mdescRight">Encode a frame of audio.  <a href="#ga93a49fbd0973b216dcb8a8c5dffe1d82">More...</a><br/></td></tr>
<tr class="separator:ga93a49fbd0973b216dcb8a8c5dffe1d82"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa2dc9e9ea2567ebb2801a08153c7306b"><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 class="memdesc:gaa2dc9e9ea2567ebb2801a08153c7306b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Encode a frame of video.  <a href="#gaa2dc9e9ea2567ebb2801a08153c7306b">More...</a><br/></td></tr>
<tr class="separator:gaa2dc9e9ea2567ebb2801a08153c7306b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga37be256d85d78f665df27ad6c8f1d65b"><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>
<tr class="separator:ga37be256d85d78f665df27ad6c8f1d65b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="ga4fde50e2cad4cf3d66d882a7078aeab4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define AV_INPUT_BUFFER_MIN_SIZE&#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="avcodec_8h_source.html#l00642">642</a> of file <a class="el" href="avcodec_8h_source.html">avcodec.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="ga09b261f1bce5161af3485cb3302edd27"></a>
<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 class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000007">Deprecated:</a></b></dt><dd>use codec private option instead </dd></dl>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="gga09b261f1bce5161af3485cb3302edd27a93dc3282c22808d298c81bfde3882c42"></a>ME_ZERO</em>&#160;</td><td class="fielddoc">
<p>no search, that is use 0,0 vector whenever one is needed </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="gga09b261f1bce5161af3485cb3302edd27a84208f4e6c361aaf87ac0c0f71116431"></a>ME_FULL</em>&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="gga09b261f1bce5161af3485cb3302edd27a712da9e85272e6bc8d73d897e40e8ab8"></a>ME_LOG</em>&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="gga09b261f1bce5161af3485cb3302edd27ab9f980e93b9500d67b1308ad0e9ce72a"></a>ME_PHODS</em>&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="gga09b261f1bce5161af3485cb3302edd27a47a2cf1ba9719d733ff2c0c0fc6e3491"></a>ME_EPZS</em>&#160;</td><td class="fielddoc">
<p>enhanced predictive zonal search </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="gga09b261f1bce5161af3485cb3302edd27a97220d3da7ac127439d96e641b48ca5f"></a>ME_X1</em>&#160;</td><td class="fielddoc">
<p>reserved for experiments </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="gga09b261f1bce5161af3485cb3302edd27a842aadc9a6d4f1c9fa20a17c77521327"></a>ME_HEX</em>&#160;</td><td class="fielddoc">
<p>hexagon based search </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="gga09b261f1bce5161af3485cb3302edd27a933a98fe54bd38c7ba77ca9a917e3bc8"></a>ME_UMH</em>&#160;</td><td class="fielddoc">
<p>uneven multi-hexagon search </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="gga09b261f1bce5161af3485cb3302edd27ad0718ff68dd2d8f9642f5ca4aab1e181"></a>ME_TESA</em>&#160;</td><td class="fielddoc">
<p>transformed exhaustive search algorithm </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="gga09b261f1bce5161af3485cb3302edd27ab2b41a1b4640728bd95c1910b111270f"></a>ME_ITER</em>&#160;</td><td class="fielddoc">
<p>iterative search </p>
</td></tr>
</table>

<p>Definition at line <a class="el" href="avcodec_8h_source.html#l00662">662</a> of file <a class="el" href="avcodec_8h_source.html">avcodec.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga9f820c481615c3a02d0407bac0bdbf25"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structAVCodec.html">AVCodec</a>* avcodec_find_encoder </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>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">id</td><td>AVCodecID of the requested encoder </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</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>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structAVCodec.html">AVCodec</a>* avcodec_find_encoder_by_name </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>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>name of the requested encoder </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>An encoder if one was found, NULL otherwise. </dd></dl>

</div>
</div>
<a class="anchor" id="ga93a49fbd0973b216dcb8a8c5dffe1d82"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int avcodec_encode_audio2 </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>Parameters</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#ga63d5a489b419bd5d45cfd09091cbcbc2" title="Wipe the packet. ">av_packet_unref()</a>. </p>
<dl class="params"><dt>Parameters</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 AV_CODEC_CAP_DELAY capability set. If AV_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="section return"><dt>Returns</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#a40">decoding_encoding.c</a>, <a class="el" href="muxing_8c-example.html#a104">muxing.c</a>, <a class="el" href="transcode_aac_8c-example.html#a83">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#l00365">encode_write_frame()</a>.</p>

</div>
</div>
<a class="anchor" id="gaa2dc9e9ea2567ebb2801a08153c7306b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int avcodec_encode_video2 </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>Parameters</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#ga63d5a489b419bd5d45cfd09091cbcbc2" title="Wipe the packet. ">av_packet_unref()</a>. </p>
<dl class="params"><dt>Parameters</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 AV_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="section return"><dt>Returns</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#a74">decoding_encoding.c</a>, <a class="el" href="muxing_8c-example.html#a120">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#l00365">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>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int avcodec_encode_subtitle </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 -->
<!-- start footer part -->
<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.8.6
</small></address>
</body>
</html>