<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
text-align:right;
direction:rtl;
unicode-bidi:embed;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:36.0pt;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
text-align:right;
direction:rtl;
unicode-bidi:embed;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Courier New";}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:476844272;
mso-list-type:hybrid;
mso-list-template-ids:-485448814 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed">Carl, firstly thank you for your answer.<o:p></o:p></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><o:p> </o:p></p>
<pre style="margin-left:36.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="color:black"><span style="mso-list:Ignore">1.<span style="font:7.0pt "Times New Roman""> </span></span></span><![endif]><span dir="LTR"></span><span style="color:black">You wrote "You could test with ffmpeg (the application) and let the libraries print the values you set in your code to find out which one is wrong"<o:p></o:p></span></pre>
<pre style="margin-left:36.0pt"><span style="color:black">What do you mean by this? Can give an example?<o:p></o:p></span></pre>
<pre style="margin-left:36.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="color:black"><span style="mso-list:Ignore">2.<span style="font:7.0pt "Times New Roman""> </span></span></span><![endif]><span dir="LTR"></span><span style="color:black">I ran the command below with ffmpeg I downloaded from http://ffmpeg.zeranoe.com/builds/ <o:p></o:p></span></pre>
<pre style="margin-left:36.0pt"><span style="color:black">"ffmpeg.exe –I c:= C:\\000227_C1_GAME.avi –vcodec libx264 c:\test.mp4"<o:p></o:p></span></pre>
<pre style="margin-left:36.0pt"><span style="color:black">I wanted to see what params it uses so I could set them in code, but I couldn't map many params to params in code. For example, AVCodecContext missing params "</span><b>rc", "mbtree", "crf", "ip_ratio"</b>. How to set them in code?<span style="color:black"><o:p></o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<pre><span style="color:black">C:\Users\igorm\Desktop\ffmpeg-20121029-git-11d695d-win32-shared\bin>ffmpeg.exe -<o:p></o:p></span></pre>
<pre><span style="color:black">i c:\000227_C1_GAME.avi -vcodec libx264 c:\test.mp4<o:p></o:p></span></pre>
<pre><span style="color:black">ffmpeg version N-46146-g11d695d Copyright (c) 2000-2012 the FFmpeg developers<o:p></o:p></span></pre>
<pre><span style="color:black"> built on Oct 29 2012 18:08:23 with gcc 4.7.2 (GCC)<o:p></o:p></span></pre>
<pre><span style="color:black"> configuration: --disable-static --enable-shared --enable-gpl --enable-version3<o:p></o:p></span></pre>
<pre><span style="color:black"> --disable-pthreads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib<o:p></o:p></span></pre>
<pre><span style="color:black">--enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-<o:p></o:p></span></pre>
<pre><span style="color:black">amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut -<o:p></o:p></span></pre>
<pre><span style="color:black">-enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger -<o:p></o:p></span></pre>
<pre><span style="color:black">-enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvo-aacenc --<o:p></o:p></span></pre>
<pre><span style="color:black">enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enab<o:p></o:p></span></pre>
<pre><span style="color:black">le-libxavs --enable-libxvid --enable-zlib<o:p></o:p></span></pre>
<pre><span style="color:black"> libavutil 52. 1.100 / 52. 1.100<o:p></o:p></span></pre>
<pre><span style="color:black"> libavcodec 54. 69.100 / 54. 69.100<o:p></o:p></span></pre>
<pre><span style="color:black"> libavformat 54. 35.100 / 54. 35.100<o:p></o:p></span></pre>
<pre><span style="color:black"> libavdevice 54. 3.100 / 54. 3.100<o:p></o:p></span></pre>
<pre><span style="color:black"> libavfilter 3. 20.109 / 3. 20.109<o:p></o:p></span></pre>
<pre><span style="color:black"> libswscale 2. 1.101 / 2. 1.101<o:p></o:p></span></pre>
<pre><span style="color:black"> libswresample 0. 16.100 / 0. 16.100<o:p></o:p></span></pre>
<pre><span style="color:black"> libpostproc 52. 1.100 / 52. 1.100<o:p></o:p></span></pre>
<pre><span style="color:black">[mpeg4 @ 0076f420] Invalid and inefficient vfw-avi packed B frames detected<o:p></o:p></span></pre>
<pre><span style="color:black">Input #0, avi, from 'c:\000227_C1_GAME.avi':<o:p></o:p></span></pre>
<pre><span style="color:black"> Duration: 00:05:59.48, start: 0.000000, bitrate: 1398 kb/s<o:p></o:p></span></pre>
<pre><span style="color:black"> Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv<o:p></o:p></span></pre>
<pre><span style="color:black">420p, 808x610 [SAR 1:1 DAR 404:305], 25 tbr, 25 tbn, 25 tbc<o:p></o:p></span></pre>
<pre><span style="color:black">File 'c:\test.mp4' already exists. Overwrite ? [y/N] y<o:p></o:p></span></pre>
<pre><span style="color:black">using SAR=1/1<o:p></o:p></span></pre>
<pre><span style="color:black">[libx264 @ 025f3c80] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE<o:p></o:p></span></pre>
<pre><span style="color:black">4.1 Cache64<o:p></o:p></span></pre>
<pre><span style="color:black">[libx264 @ 025f3c80] profile High, level 3.1<o:p></o:p></span></pre>
<pre><span style="color:black">[libx264 @ 025f3c80] 264 - core 128 r2216 198a7ea - H.264/MPEG-4 AVC codec - Cop<o:p></o:p></span></pre>
<pre><span style="color:black">yleft 2003-2012 - http://www.videolan.org/x264.html - options: </span><b>cabac=1 ref=3 deb<o:p></o:p></b></pre>
<pre><b>lock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 m<o:p></o:p></b></pre>
<pre><b>e_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chro<o:p></o:p></b></pre>
<pre><b>ma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 i<o:p></o:p></b></pre>
<pre><b>nterlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1<o:p></o:p></b></pre>
<pre><b>b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenec<o:p></o:p></b></pre>
<pre><b>ut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=<o:p></o:p></b></pre>
<pre><b>0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00</b><o:p></o:p></pre>
<pre><span style="color:black">Output #0, mp4, to 'c:\test.mp4':<o:p></o:p></span></pre>
<pre><span style="color:black"> Metadata:<o:p></o:p></span></pre>
<pre><span style="color:black"> encoder : Lavf54.35.100<o:p></o:p></span></pre>
<pre><span style="color:black"> Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 808x610 [SAR 1:1<o:p></o:p></span></pre>
<pre><span style="color:black"> DAR 404:305], q=-1--1, 12800 tbn, 25 tbc<o:p></o:p></span></pre>
<pre><span style="color:black">Stream mapping:<o:p></o:p></span></pre>
<pre><span style="color:black"> Stream #0:0 -> #0:0 (mpeg4 -> libx264)<o:p></o:p></span></pre>
<pre><span style="color:black">Press [q] to stop, [?] for help<o:p></o:p></span></pre>
<pre><span style="color:black">[mpeg4 @ 04ca3840] Invalid and inefficient vfw-avi packed B frames detected<o:p></o:p></span></pre>
<pre><span style="color:black">frame= 57 fps=0.0 q=28.0 size= 71kB time=00:00:00.20 bitrate=2896.9kbits/<o:p></o:p></span></pre>
<pre><span style="color:black">frame= 89 fps= 88 q=28.0 size= 202kB time=00:00:01.48 bitrate=1117.3kbits/<o:p></o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<p class="MsoListParagraph" style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:36.0pt;margin-bottom:.0001pt;text-align:left;direction:ltr;unicode-bidi:embed">
<span style="font-size:10.0pt;font-family:"Courier New";color:black"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:36.0pt;margin-bottom:.0001pt;text-align:left;text-indent:-18.0pt;mso-list:l0 level1 lfo1;direction:ltr;unicode-bidi:embed">
<![if !supportLists]><span style="mso-list:Ignore">3.<span style="font:7.0pt "Times New Roman"">
</span></span><![endif]><span dir="LTR"></span><o:p> </o:p></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed">I tested my code and it does compile! I compile it in VS2010 after configuring "VC++ Directories" in Property Pages of the project. What error do you get?<o:p></o:p></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed">Here the whole code with includes I use<o:p></o:p></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><o:p> </o:p></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas;color:blue">#include</span><span style="font-size:9.5pt;font-family:Consolas">
<span style="color:#A31515">"stdafx.h"</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas;color:blue">#include</span><span style="font-size:9.5pt;font-family:Consolas">
<span style="color:#A31515">"inttypes.h"</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas;color:blue">extern</span><span style="font-size:9.5pt;font-family:Consolas">
<span style="color:#A31515">"C"</span> {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas;color:blue">#include</span><span style="font-size:9.5pt;font-family:Consolas">
<span style="color:#A31515">"libavcodec/avcodec.h"</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas;color:blue">#include</span><span style="font-size:9.5pt;font-family:Consolas">
<span style="color:#A31515">"libavformat/avformat.h"</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas;color:blue">#include</span><span style="font-size:9.5pt;font-family:Consolas">
<span style="color:#A31515">"libavutil/avutil.h"</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas;color:blue">#include</span><span style="font-size:9.5pt;font-family:Consolas">
<span style="color:#A31515"><libswscale/swscale.h></span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas;color:blue">#include</span><span style="font-size:9.5pt;font-family:Consolas">
<span style="color:#A31515"><libavutil/opt.h></span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas;color:blue">#include</span><span style="font-size:9.5pt;font-family:Consolas">
<span style="color:#A31515"><libswscale/swscale.h></span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas;color:blue">#include</span><span style="font-size:9.5pt;font-family:Consolas">
<span style="color:#A31515"><libavutil/imgutils.h></span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas">}<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas;color:blue">#include</span><span style="font-size:9.5pt;font-family:Consolas">
<span style="color:#A31515"><iostream></span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas;color:blue">using</span><span style="font-size:9.5pt;font-family:Consolas">
<span style="color:blue">namespace</span> sv;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas;color:blue">using</span><span style="font-size:9.5pt;font-family:Consolas">
<span style="color:blue">namespace</span> std;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas;color:green">//TODO: use thread_count to increase converting speed</span><span style="font-size:9.5pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas;color:blue">int</span><span style="font-size:9.5pt;font-family:Consolas"> main(<span style="color:blue">int</span> argc,
<span style="color:blue">char</span>* argv[])<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas">{<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas"> <o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas"> <span style="color:green">// ****************************************<o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas;color:green"> // </span>
<b><span style="font-size:12.0pt;font-family:Consolas;color:green">Here goes the code from my last post</span></b><b><span style="font-size:12.0pt;font-family:Consolas"><o:p></o:p></span></b></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas"> <span style="color:green">
// ****************************************<o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas"> <span style="color:blue">
return</span> 0;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas">}<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-align:left;text-autospace:none;direction:ltr;unicode-bidi:embed">
<span style="font-size:9.5pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><o:p> </o:p></p>
</div>
</body>
</html>