<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 15 (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:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></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="CA" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi!<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">We are integrating ffmpeg in our product, in order to use NVIDIA hardware decoding capabilities for performance reasons. But we need the impact on the GPU (CUDA) side to be minimal, since our software intensively uses
 the GPU with CUDA.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">When creating the hardware context (av_hwdevice_ctx_create), we would like to be able to specify that ffmpeg uses the current cuda context, and if possible, to specify a cuda stream, so all the internal calls to the cuda
 runtime (kernels, memory copies) are performed asynchronously, and we can synchronize either on GPU or CPU since we have access to the cuda stream where those calls where enqueued.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">We have been looking into the source code (libavutil), and we don</span><span lang="EN-US" style="font-family:"Times New Roman",serif">’</span><span lang="EN-US">t see that possibility.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">We have some ideas of how to make that possible by changing ffmpeg code, which we want to post on the ffmpeg-devel forums, but first we want to make sure we are not missing any way to do what we want to do with current
 ffmpeg code. <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">So, is it possible to tell ffmpeg to use the current CUDA context and specify a cudaStream?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks!<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Oscar<o:p></o:p></span></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="961" style="width:721.1pt;margin-left:-5.4pt;border-collapse:collapse">
<tbody>
<tr style="height:10.25pt">
<td width="961" valign="top" style="width:721.1pt;padding:0in 5.4pt 0in 5.4pt;height:10.25pt">
<p class="MsoNormal" style="margin-bottom:12.0pt">___<o:p></o:p></p>
</td>
</tr>
<tr style="height:13.05pt">
<td width="961" valign="top" style="width:721.1pt;padding:0in 5.4pt 0in 5.4pt;height:13.05pt">
<p class="MsoNormal"><b><span style="mso-fareast-language:ES-TRAD"><img width="160" height="25" style="width:1.6666in;height:.2604in" id="Picture_x0020_1" src="cid:image001.jpg@01D3CD09.F37CABB0" alt="id:image001.jpg@01D27CB1.F5DE7C20"></span></b><b><o:p></o:p></b></p>
<p class="MsoNormal"><b><o:p> </o:p></b></p>
</td>
</tr>
<tr style="height:21.95pt">
<td width="961" valign="top" style="width:721.1pt;padding:0in 5.4pt 0in 5.4pt;height:21.95pt">
<p class="MsoNormal"><b><span lang="EN-US" style="font-family:"Arial",sans-serif">Oscar Amoros Huguet</span></b><b><span lang="EN-US" style="font-size:12.0pt;font-family:"Arial",sans-serif"><o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#9E9E9E">CUDA lead engineer<o:p></o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-family:"Arial",sans-serif">AUTOMATIC<span style="color:#D22C2A">TV</span><o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span lang="EN-US"><o:p> </o:p></span></b></p>
</td>
</tr>
<tr style="height:33.25pt">
<td width="961" valign="top" style="width:721.1pt;padding:0in 5.4pt 0in 5.4pt;height:33.25pt">
<p class="MsoNormal"><b><span style="font-family:"Arial",sans-serif;color:#DF543D">MEDIAPRO</span></b><b><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#DF543D"><o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#9E9E9E">Av. Diagonal 177, Planta 14<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#9E9E9E">08018 Barcelona - Spain<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#9E9E9E">T: + 34 93 476 15 51<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#9E9E9E">Extension: 2337</span><span lang="EN-US" style="font-family:"Arial",sans-serif;color:#9E9E9E"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial",sans-serif;color:#9E9E9E">oamoros@mediapro.es</span><b><span lang="EN-US" style="font-family:"Arial",sans-serif"><o:p></o:p></span></b></p>
</td>
</tr>
<tr style="height:10.25pt">
<td width="961" valign="top" style="width:721.1pt;padding:0in 5.4pt 0in 5.4pt;height:10.25pt">
<p class="MsoNormal"><b><span style="font-family:"Arial",sans-serif;color:#D22C2A"><a href="http://www.automatic.tv/"><span style="color:#D22C2A;text-decoration:none">www.automatic.tv</span></a><o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family:"Arial",sans-serif"><o:p> </o:p></span></b></p>
</td>
</tr>
<tr style="height:87.95pt">
<td width="961" valign="top" style="width:721.1pt;padding:0in 5.4pt 0in 5.4pt;height:87.95pt">
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Arial",sans-serif;color:#9E9E9E">DISCLAIMER: This message and its eventual attached documents are exclusively intended to their owners. If you receive this message by mistake, you must
 notify the sender and delete the message and its attachments, and do not make any copies.</span><span lang="EN-US" style="font-size:8.0pt;font-family:"Arial",sans-serif;color:#9E9E9E"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Arial",sans-serif;color:#9E9E9E"> </span><span lang="EN-US" style="font-size:8.0pt;font-family:"Arial",sans-serif;color:#9E9E9E"><o:p></o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-GB" style="font-size:8.0pt;font-family:"Arial",sans-serif;color:#9E9E9E">MEDIAPRODUCCIÓN, S.L.U.</span></b><span lang="EN-GB" style="font-size:8.0pt;font-family:"Arial",sans-serif;color:#9E9E9E">, informs you that according
 to LO 15/1999, for the protection of personal data your data will be included in a file of our responsibility in order to maintain professional relationship and sending commercial communications regarding our products and services. Your data may be communicated
 to other companies of Grupo Imagina (<a href="http://entidades.imagina-media.com/"><span style="color:#0563C1">http://entidades.imagina-media.com/</span></a>) for the above purposes, including those located outside the territory of the European Union. You
 can exercise your rights of access, rectification, cancellation, opposition by enclosing a photocopy of ID to <b>MEDIAPRODUCCIÓN, S.L.U.</b>, Av. Diagonal 177, 12<sup>th</sup> floor, 08018 Barcelona; or by e-mail to the following address:   <a href="mailto:lopd@mediapro.es"><span style="color:#0563C1">lopd@mediapro.es</span></a>.</span><span lang="EN-US" style="font-size:8.0pt;font-family:"Arial",sans-serif;color:#9E9E9E"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>