title: ffmpeg unexpected exit code 1 for -list_devices and -list_options
body: <h3>Description</h3>
  <p>If I run any of the following commands from the <a href="https://ffmpeg.org/ffmpeg-devices.html#Examples-2" rel="nofollow noreferrer">examples in the documentation</a>, using <code>ffmpeg</code> 4.2.2 on Windows 10, the requested information <em>is</em> successfully displayed in the console, <em>but</em> the process exits with exit code <code>1</code>, instead of the expected <code>0</code> (success).</p>
  <pre><code>ffmpeg -list_devices true -f dshow -i dummy
  
  ffmpeg -list_options true -f dshow -i video=&quot;MyCamera&quot;
  </code></pre>
  <p>As far as I know, exit code <code>1</code> on Windows implies <a href="https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-" rel="nofollow noreferrer">&quot;Incorrect function&quot;</a>, so I consider this behavior to be unexpected.</p>
  <p>If I stream camera input to disk, using e.g. <code>ffmpeg -f dshow -i video=&quot;MyCamera&quot; &quot;myfile.mp4&quot;</code>, then stop using <kbd>q</kbd>, the exit code is <code>0</code>, as expected.</p>
  <h3>Question</h3>
  <p>Does the exit code <code>1</code> constitute normal behavior for <code>ffmpeg</code>, or am I doing something wrong?</p>
  <h3>Relevance</h3>
  <p>When running the commands manually, from the command line, the exit code does not make much difference, as long as the requested information is displayed.</p>
  <p>However, when running the commands programmatically, it may cause trouble. For example, using Python's <code>subprocess.run(..., check=True)</code>, the nonzero exit code causes a <a href="https://docs.python.org/3/library/subprocess.html#subprocess.CalledProcessError" rel="nofollow noreferrer">CalledProcessError</a>.</p>
  <p><em>Of course there are ways around this, e.g. use <code>check=False</code>, but the point is that a workaround would not be necessary if <code>ffmpeg</code> behaved as expected, i.e. returned <code>0</code>.</em></p>