<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hey there,<div><br></div><div>I’m writing a ProRes encoder and I’d like to be able to set the profile.</div><div>I asked this a couple of days ago already and I was told that I should have a look at the source file for the Pro Res encoder.</div><div><br></div><div>In the one I have here the options are defined as follows (just an excerpt):</div><div><br></div><div><div style="margin: 0px; font-family: Menlo;"><span style="color: #c7289c">static</span> <span style="color: #c7289c">const</span> AVOption options[] = {</div><div style="margin: 0px; font-family: Menlo;">    { <span style="color: #d12f1b">"mbs_per_slice"</span>, <span style="color: #d12f1b">"macroblocks per slice"</span>, OFFSET(mbs_per_slice), AV_OPT_TYPE_INT, { .i64 = <span style="color: #272ad8">8</span> }, <span style="color: #272ad8">1</span>, MAX_MBS_PER_SLICE, VE },</div><div style="margin: 0px; font-family: Menlo;">    { <span style="color: #d12f1b">"profile"</span>, <span style="color: #c7289c">NULL</span>,       OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = PRORES_PROFILE_STANDARD }, PRORES_PROFILE_PROXY, PRORES_PROFILE_4444, VE, <span style="color: #d12f1b">"profile"</span> },</div><div style="margin: 0px; font-family: Menlo;">    { <span style="color: #d12f1b">"proxy"</span>, <span style="color: #c7289c">NULL</span>, <span style="color: #272ad8">0</span>, AV_OPT_TYPE_CONST, { .i64 = PRORES_PROFILE_PROXY }, <span style="color: #272ad8">0</span>, <span style="color: #272ad8">0</span>, VE, <span style="color: #d12f1b">"profile"</span> },</div><div style="margin: 0px; font-family: Menlo;">    { <span style="color: #d12f1b">"lt"</span>, <span style="color: #c7289c">NULL</span>, <span style="color: #272ad8">0</span>, AV_OPT_TYPE_CONST, { .i64 = PRORES_PROFILE_LT }, <span style="color: #272ad8">0</span>, <span style="color: #272ad8">0</span>, VE, <span style="color: #d12f1b">"profile"</span> },</div><div style="margin: 0px; font-family: Menlo;">    { <span style="color: #d12f1b">"standard"</span>, <span style="color: #c7289c">NULL</span>, <span style="color: #272ad8">0</span>, AV_OPT_TYPE_CONST, { .i64 = PRORES_PROFILE_STANDARD }, <span style="color: #272ad8">0</span>, <span style="color: #272ad8">0</span>, VE, <span style="color: #d12f1b">"profile"</span> },</div><div style="margin: 0px; font-family: Menlo;">    { <span style="color: #d12f1b">"hq"</span>, <span style="color: #c7289c">NULL</span>, <span style="color: #272ad8">0</span>, AV_OPT_TYPE_CONST, { .i64 = PRORES_PROFILE_HQ }, <span style="color: #272ad8">0</span>, <span style="color: #272ad8">0</span>, VE, <span style="color: #d12f1b">"profile"</span> },</div><div style="margin: 0px; font-family: Menlo;">    { <span style="color: #d12f1b">"4444"</span>,          <span style="color: #c7289c">NULL</span>, <span style="color: #272ad8">0</span>, AV_OPT_TYPE_CONST, { .i64 = PRORES_PROFILE_4444 },</div></div><div><br></div><div>And that’s how I tried to set the option:</div><div><br></div><div><div style="margin: 0px; font-family: Menlo;">    <span style="color: #703daa">AVDictionary</span>* kvDict = <span style="color: #c7289c">NULL</span>;</div><div style="margin: 0px; font-family: Menlo;">    <span style="color: #3d1d81">av_dict_set</span>(&kvDict, <span style="color: #d12f1b">"profile"</span>, <span style="color: #d12f1b">"lt"</span>, <span style="color: #272ad8">0</span>);</div><p style="margin: 0px; font-family: Menlo; min-height: 14px;">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-family: Menlo; color: rgb(0, 132, 0);"><span style="color: #000000">    </span>/* open the codec */</div><div style="margin: 0px; font-family: Menlo;">    ret = <span style="color: #3d1d81">avcodec_open2</span>(<span style="color: #c7289c">this</span>-><span style="color: #4f8187">codecCtx</span>, <span style="color: #4f8187">videoCodec</span>, &kvDict);</div><p style="margin: 0px; font-family: Menlo; min-height: 14px;"><br></p><p style="margin: 0px; min-height: 14px;">This seems to be wrong as I’m getting the following error message:</p><p style="margin: 0px; font-family: Menlo; min-height: 14px;"><br></p><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><b>[NULL @ 0x10180a000] [Eval @ 0x7fff5fbfe8b0] Undefined constant or missing '(' in 'lt'</b></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><b>[NULL @ 0x10180a000] Unable to parse option value "lt"</b></div><p style="margin: 0px; font-family: Menlo; min-height: 14px;"><b style="font-size: 11px;">[NULL @ 0x10180a000] Error setting option profile to value lt.</b></p><p style="margin: 0px; font-family: Menlo; min-height: 14px;"><br></p><p style="margin: 0px; min-height: 14px;">Can anyone clarify what I’m doing wrong and tell me how to do it correctly?</p><p style="margin: 0px; min-height: 14px;"><br></p><p style="margin: 0px; min-height: 14px;">Thanks!!</p><p style="margin: 0px; min-height: 14px;">Best,</p><p style="margin: 0px; min-height: 14px;"><br></p><p style="margin: 0px; min-height: 14px;">Flo<span style="font-family: Menlo;">   </span></p></div></body></html>