<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; Master</li>
<li>Operating System / Platform =&gt; Any</li>
<li>Compiler =&gt; Any</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">I am using the FFV1 codec proivded by FFMPEG to record videos with <code class="notranslate">VideoWriter</code>. This defaults to using FFV1 version 3, however, I would like to change the codec used to FFV1 version 1. In plain FFMPEG this can be done by passing the <code class="notranslate">-level 1</code> flag to the call.</p>
<p dir="auto">Is it possible to do something like this through OpenCV? So far, I have not found anything useful regarding this.</p>
<p dir="auto">I have asked the same <a href="https://answers.opencv.org/question/222493/setting-codec-parameters-with-ffmpeg-backend/" rel="nofollow">question</a> on the forum but have recieved no response. Hence I am asking here as well.</p>
<p dir="auto">I'm looking for guidance in regards to submitting a PR that will allow you to specify raw options (i.e preset) using av_dict_set. This applies to <code class="notranslate">VideoCapture</code> and <code class="notranslate">VideoWriter</code> The use case here being that you could support encoding videos targeting a specific device (i.e Apple iPad). Or tune encoding performance for a given codec i.e. <a href="http://www.ffmpeg.org/doxygen/3.0/libvpxenc_8c_source.html#1061" rel="nofollow">VP9</a></p>
<p dir="auto"><strong>Specify backend options by instantiating a new VideoWriter (!?)</strong></p>
<div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="VideoWriter::VideoWriter(const String&amp; filename, int fourcc, double fps, Size frameSize, bool isColor=true, std::map&lt;std::string, std::string&gt; backendOptions)"><pre class="notranslate"><span class="pl-en">VideoWriter::VideoWriter</span>(<span class="pl-k">const</span> String&amp; filename, <span class="pl-k">int</span> fourcc, <span class="pl-k">double</span> fps, <span class="pl-c1">Size</span> frameSize, <span class="pl-k">bool</span> isColor=<span class="pl-c1">true</span>, std::map&lt;std::string, std::string&gt; backendOptions)</pre></div>