<p>I have a .webm video captured through a web browser. Using ffmpeg, I want to trim it into its first 30s <strong>without</strong> re-encoding and quality degradation. But I have issues doing it and ffmpeg complains about it.</p>
<p>What is the problem? How can I address it?</p>
<pre><code>ffmpeg -i video.webm -to 30 -c copy out.webm
</code></pre>
<p>Error:</p>
<pre><code>[webm @ 0000014ea3249a00] Only VP8 or VP9 or AV1 video and Vorbis or Opus audio and WebVTT subtitles are supported for WebM.
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:1 --
</code></pre>

CC BY-SA 4.0
2022-09-22T04:02:10.900Z
WebRTC saves even H264 to webm which is not compatible. Save to mkv.
Gyan
CC BY-SA 4.0
2022-09-22T14:45:32.977Z
Would it work to save to .mp4? Any issues? It works for me though.
angel_30
CC BY-SA 4.0
2022-09-22T16:08:05.647Z
Depends on the codecs.
Gyan
CC BY-SA 4.0
2022-09-22T16:37:40.973Z
AVC video and Opus audio.
angel_30
CC BY-SA 4.0
2022-09-23T04:12:42.333Z
AVC is fine  Opus is not commonly accepted in MP4. Transcode audio to AAC.
Gyan
CC BY-SA 4.0
2022-09-23T14:19:45.417Z
I renamed it as .mp4 and Opus looks fine.
angel_30
<ffmpeg><video><encoding><transcoding><webvideos>
Issues in trimming a video with FFmpeg
angel_30
# Issues in trimming a video with FFmpeg

(Asked by: username_0 on 2022-09-21)

I have a .webm video captured through a web browser. Using ffmpeg, I want to trim it into its first 30s without re-encoding and quality degradation. But I have issues doing it and ffmpeg complains about it.
What is the problem? How can I address it?
ffmpeg -i video.webm -to 30 -c copy out.webm

Error:
[webm @ 0000014ea3249a00] Only VP8 or VP9 or AV1 video and Vorbis or Opus audio and WebVTT subtitles are supported for WebM.
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:1 --

**Tags:** ffmpeg, video, encoding, transcoding, webvideos

> **Comments:**
> **username_1**: WebRTC saves even H264 to webm which is not compatible. Save to mkv.  
> **username_0**: Would it work to save to .mp4? Any issues? It works for me though.  
> **username_1**: Depends on the codecs.  
> **username_0**: AVC video and Opus audio.  
> **username_1**: AVC is fine  Opus is not commonly accepted in MP4. Transcode audio to AAC.  
> **username_0**: I renamed it as .mp4 and Opus looks fine.  

---

## 0 answers

