user23966: I'm totally new to ffmpeg and use it on windows.
I want to encode the audio from a mkv video to opus, using
ffmpeg -i abc.mkv -map 0:v -c copy -map 0:a -c libopus -b:a 128000 xyz.mkv

but I get the error:
invalid encoder type "libopus". 

What am I doing wrong?

user1871: Just -c on its own will set the encoder for all types of streams: video, audio..etc. libopus can't encode video, obviously. You need to attach a stream specifier to limit it to audio, so
ffmpeg -i abc.mkv -map 0:v -c copy -map 0:a -c:a libopus -b:a 128k xyz.mkv

See the section on stream specifiers and also this answer on how multiple codec settings in a command works.

23966: <p>I'm totally new to ffmpeg and use it on windows.
I want to encode the audio from a mkv video to opus, using</p>

<pre><code>ffmpeg -i abc.mkv -map 0:v -c copy -map 0:a -c libopus -b:a 128000 xyz.mkv
</code></pre>

<p>but I get the error:</p>

<pre><code>invalid encoder type "libopus". 
</code></pre>

<p>What am I doing wrong?</p>
 1871: <p>Just <code>-c</code> on its own will set the encoder for all types of streams: video, audio..etc. libopus can't encode video, obviously. You need to attach a stream specifier to limit it to audio, so</p>

<pre><code>ffmpeg -i abc.mkv -map 0:v -c copy -map 0:a -c:a libopus -b:a 128k xyz.mkv
</code></pre>

<p>See the section on <a href="https://ffmpeg.org/ffmpeg.html#Stream-specifiers-1" rel="nofollow noreferrer">stream specifiers</a> and also this <a href="https://superuser.com/a/1219824/114058">answer</a> on how multiple codec settings in a command works.</p>
