1

How can I remove one, or multiple segments from a webm video using avconv (without reencoding)?

whtyger
  • 5,710
  • 3
  • 32
  • 45
  • I'm not sure if there is a more elegant solution, but you could [create clips of wanted video individually using time splicing](http://askubuntu.com/a/399028/13247). – earthmeLon Feb 27 '16 at 21:24
  • Note: You will probably need to re-encode, but at a lossless rate. (See [P-Frames and B-Frames](https://en.wikipedia.org/wiki/Video_compression_picture_types)) – earthmeLon Feb 27 '16 at 21:31
  • The question is a bit unclear. Do you want to make a new video out of the webm video, without the removed segments? If yes, you can use the command above for the parts you want to KEEP, then concatenate those parts. – theodorn Feb 27 '16 at 21:35
  • yes, i want to make video without removed segments. – Марат Кудяков Feb 28 '16 at 09:47

1 Answers1

2

To remove a single segment of a webm file you can use the standard method of seeking to a particular section of your file and then specifying a time duration to extract.

For example the following will take a section from 1 minute into a file and copy 60 seconds following this into another file:

avconv -ss 00:01:00 -i video.webm -t 60 -c copy cut.webm

To extract multiple segments of a webm file you can use avconv's basic stream segmenter. For example the following will split a webm video into 60 second segments and generate a playlist file as well:

avconv -i test.webm -c copy \
       -f segment -segment_time 60 -segment_list list.pls \
       output%03d.webm

A few choices to make with the segmenter but the above examples covers the basics...

andrew.46
  • 37,085
  • 25
  • 149
  • 228
  • Good answer. I tested it with segment_time = 10 sec and a 1:04 long file. A roughly one minute long file seems was split into seven files. The time stamps were a bit strange in VLC. Each file was reported at the added time length of all the files before, including the file itself. However each file played at a shorter time, and the whole playtime added up to 1:04, same as the original file. – theodorn Feb 29 '16 at 11:35