# How do I write animation video files in VP9 (libvpx) codec format using vtk ?

**URL:** https://discourse.vtk.org/t/how-do-i-write-animation-video-files-in-vp9-libvpx-codec-format-using-vtk/1478
**Category:** Development
**Created:** [August 2, 2019, 8:33pm UTC](https://discourse.vtk.org/t/how-do-i-write-animation-video-files-in-vp9-libvpx-codec-format-using-vtk/1478 "2019-08-02T20:33:01Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![aravind90](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/ba8739/32.png) [@aravind90](https://discourse.vtk.org/u/aravind90)
#### Post date: [August 2, 2019, 8:33pm UTC](https://discourse.vtk.org/t/how-do-i-write-animation-video-files-in-vp9-libvpx-codec-format-using-vtk/1478/1 "2019-08-02T20:33:01Z")

</div>

I was successful in saving animation video using classes vtkAVIWriter and vtkFFMPEGWriter with different codec formats, but I would prefer saving videos in VP9 codec format (libvpx) which is completely royalty free. Has anyone tried to create a custom Writer class for VP9?

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [August 3, 2019, 2:09am UTC](https://discourse.vtk.org/t/how-do-i-write-animation-video-files-in-vp9-libvpx-codec-format-using-vtk/1478/2 "2019-08-03T02:09:45Z")

</div>

We implemented VTK classes for [VP9 encoding/decoding](https://github.com/IGSIO/IGSIO/blob/master/Source/Codecs/vtkVP9VolumeCodec.h) and [storage of images + text metadata in MKV container](https://github.com/IGSIO/IGSIO/tree/master/Source/SequenceIO) in [IGSIO library](https://github.com/IGSIO/IGSIO). There are a couple of tests/examples in the repository and the library is used in [3D Slicer](https://www.slicer.org) and [Plus toolkit](https://www.plustoolkit.org) for record/replay/stream compressed video. If you have any questions about how to use the library then you can post them as issues in the IGSIO repository.

---

<div class="post-metadata">

### Author: ![aravind90](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/ba8739/32.png) [@aravind90](https://discourse.vtk.org/u/aravind90)
#### Post date: [August 3, 2019, 2:32am UTC](https://discourse.vtk.org/t/how-do-i-write-animation-video-files-in-vp9-libvpx-codec-format-using-vtk/1478/3 "2019-08-03T02:32:39Z")

</div>

How does the mkv container differ from vtkAVIWriter or vtkFFMPEFWriter it doesn’t seem to implement vtkGenericMovieWriter?

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [August 3, 2019, 2:50am UTC](https://discourse.vtk.org/t/how-do-i-write-animation-video-files-in-vp9-libvpx-codec-format-using-vtk/1478/4 "2019-08-03T02:50:41Z")

</div>

We don’t use vtkGenericMovieWriter interface, as it would be too way too limited for our use cases. Instead, we store input image sequence in [vtkIGSIOTrackedFrameList](https://github.com/IGSIO/IGSIO/blob/master/Source/IGSIOCommon/vtkIGSIOTrackedFrameList.h), which allows random read/write access of compressed and uncompressed frames, arbitrarily varying frame rate, per-frame metadata, managing of missing frames, etc.
