<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>

CC BY-SA 4.0
2018-12-23T16:26:50.663Z
2018-12-23T16:26:50.663Z
Gyan
<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>

<ffmpeg>
convert audio to libopus with ffmpeg
Mike8725
# convert audio to libopus with ffmpeg

(Asked by: username_0 on 2018-12-23)

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?

**Tags:** ffmpeg


---

## 1 answers

### Answer by username_1 on 2018-12-23. Score: 1 | Accepted answer

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.


---

