How to convert a webm video file seekable?

Updated on August 31, 2021

Recently I used a chrome extension to record screen and got the output as a webm file. Although I was happy that I got an extension to record my long meetings, the output webm file was not seekable. Meaning I cannot play the video at a specific point of the video. A long video without seeking controls is not much useful right? Solution – convert the webm file to another format like mp4 or make it a seekable webm video file. I choose the second option!

What is a webm file?

If you are a developer or a tech savvy person, you would have heard about the webp image files, webm are to that for videos.

Webm is a audio video file, that has native support in modern browsers. It is optimized for web and has low computational footprint. It is also supported in various players.

The WebM Project | About WebM

Why does the file go non seekable?

May be the video that you had was recorded real-time or in real time mode. In my case my screen recording extension was actually recording real-time. So they don’t have the metadata or duration as the duration is unknown by the time the header is written.

How to convert a non seekable webm file to a seekable webm video file?

If you had already used npm packages, this is simple as running a couple of commands.

You have the video file that is non real-time, you can use a relevant package like ts-ebml to add the metadata, duration and other information and convert a non seekable file to a seekable webm video file.

Run the below commands

npm i ts-embl

ts-ebml -s video.webm | cat > seekable-video.webm

And that is it, you have now converted your video into seekable one.

Was this article helpful?

Related Articles

Comments Leave a Comment

  1. I have tried to use this method, But my files have size more than 2GB due to which it is throwing an error, Would like to know if there is a work around or an alternative for this

Leave a Comment