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