1

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

whtyger
  • 5,810
  • 3
  • 33
  • 46

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
  • 38,003
  • 27
  • 156
  • 232
  • 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