<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=iso-8859-1"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        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;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Texte de bulles Car";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.TextedebullesCar
        {mso-style-name:"Texte de bulles Car";
        mso-style-priority:99;
        mso-style-link:"Texte de bulles";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="2050" />
</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=FR link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Hello, I'm using FFMPEG to decode video streaming from an IP Camera. all seems good but I try to decrease the CPU usage of my application when I decompress several differents streams.<br>In fact, I have a dual core processor, and if I decode one stream, my CPU usage is very low (so good). If I decompress two streams, it's ok too. But if I had a third decompression, my CPU increase from 2-5% to 25-30%.<br><br>So, I try to activate Mutlithreading in FFMPEG (compiling with --enable-w32threads) with Mingw.<o:p></o:p></p><p class=MsoNormal><br>But if I initialize my AVCodecContext with thread_count=3 (because I have a dual core processor) and thread_type = FF_THREAD_FRAME|FF_THREAD_SLICE, when I use avcodec_open2, I always got an result error -22: The maximum value for lowres supported by the decoder is 0. I read where this message appear in FFMPEG code source and it's in utils.c<br><br>if (avctx->codec->max_lowres < avctx->lowres || avctx->lowres < 0)<br><br>But in my code before call avcodec_open2( lpCodecCtx, lpCodec, ...) I have m_lpCodec->max_lowres=0 and m_lpCodecCtx->lowres=0, so I don't understa,nd why I always have this error.<br><br><o:p></o:p></p><p class=MsoNormal>After add some traces in Utils.c, it seems I have avctx->codec->max_lowres=0 and avctx->lowres=3 but I don’t understand why…<o:p></o:p></p><p class=MsoNormal><br>Perhaps, trying Multithreading isn"t the good solution to decrease the CPU usage, I'm not very sure of this point.<o:p></o:p></p><p class=MsoNormal><br>Thanks for your answers,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><b><span style='font-family:"Arial","sans-serif";color:#003399'>Jérôme SALAYET</span></b><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><br></span><b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:black'>Ingénieur Informatique</span></b><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><br></span><b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:gray'>Tél :    04 67 87 61 12</span></b><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><br></span><b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:gray'>Fax :   04 67 70 85 44</span></b><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><br></span><b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:gray'>Site web : </span></b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:gray'><a href="http://www.hymatom.fr/"><span style='color:blue'>www.hymatom.fr</span></a></span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><br></span><b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:gray'>Email : </span></b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:gray'><a href="mailto:jerome.salayet@hymatom.fr"><span style='color:blue'>jerome.salayet@hymatom.fr</span></a></span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><br></span><span style='font-size:5.0pt;font-family:"Arial","sans-serif"'><br></span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><img border=0 width=329 height=68 id="_x0000_i1025" src="cid:image001.png@01CE062D.10719FE0" alt=" "></span><o:p></o:p></p></div></body></html>