# Video compression in Slicer core

**URL:** <https://discourse.slicer.org/t/video-compression-in-slicer-core/1846>\
**Category:** Development\
**Created:** [January 15, 2018, 3:13pm UTC](https://discourse.slicer.org/t/video-compression-in-slicer-core/1846 "2018-01-15T15:13:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)\
**Post date:** [January 15, 2018, 3:13pm UTC](https://discourse.slicer.org/t/video-compression-in-slicer-core/1846/1 "2018-01-15T15:13:33Z")

</div>

Hi All,

With the growing desire to have video compression accessible within Slicer, it would be useful to have a discussion regarding how to go about integrating it into the Slicer core.

1. Adding a video codec interface into the Slicer core:

2. A related topic is whether we should move OpenIGTLinkIF from the Slicer core to its own extension.

What are everyone’s thoughts?

@lassoan @tokjun (I couldn’t find Longquan’s username)

---

<div class="post-metadata">

**Author:** ![leochan2009](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/leochan2009/32/519_2.png) [@leochan2009](https://discourse.slicer.org/u/leochan2009)\
**Post date:** [January 15, 2018, 3:35pm UTC](https://discourse.slicer.org/t/video-compression-in-slicer-core/1846/2 "2018-01-15T15:35:05Z")

</div>

@Sunderlandkyl, This is Longquan 🙂  
I find it a good idea to move the OpenIGTLinkIF module to the extensions for fixing bugs and adding new features.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [January 15, 2018, 3:35pm UTC](https://discourse.slicer.org/t/video-compression-in-slicer-core/1846/3 "2018-01-15T15:35:50Z")

</div>

I think topic 1 is quite clear - we would benefit a lot from having video compression infrastructure in the Slicer core, and having it in extensions would allow us greater flexibility and wider choice of codecs.

OpenIGTLinkIF in core/extension: I don’t see much advantage of having OpenIGTLinkIF in the core, other than slightly increased visibility of the feature (but IGT category name is not that welcoming and if people don’t know what the module is for, they cannot figure it out by opening the module), and there are many small disadvantages (we cannot update it in stable builds, we don’t get specific download statistics, the IGT category is not highlighted when we install IGT extensions, …). It seems that using custom codecs would be easier to set up if OpenIGTLinkIF is in a separate extension (OpenIGTLink library could use the codecs directly, there would be no need to create a dynamic codec plugin infrastructure in OpenIGTLink). So, to me it looks like overall it would make more sense to not bundle OpenIGTLinkIF with the Slicer core by default.

Adding @ungi to the discussion as well.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [January 15, 2018, 3:47pm UTC](https://discourse.slicer.org/t/video-compression-in-slicer-core/1846/4 "2018-01-15T15:47:43Z")

</div>

+1 to moving OpenIGTLinkIF to an extension.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [January 15, 2018, 7:58pm UTC](https://discourse.slicer.org/t/video-compression-in-slicer-core/1846/5 "2018-01-15T19:58:31Z")

</div>

I talked to @ungi and he would have no objections to move out OpenIGTLinkIF either (he said he always installed SlicerIGT before doing anything anyway, and we could make SlicerIGT extension to depend on OpenIGTLink extension).

---

<div class="post-metadata">

**Author:** ![tokjun](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tokjun/32/1057_2.png) [@tokjun](https://discourse.slicer.org/u/tokjun)\
**Post date:** [January 16, 2018, 2:20pm UTC](https://discourse.slicer.org/t/video-compression-in-slicer-core/1846/6 "2018-01-16T14:20:45Z")

</div>

I agree, moving OpenIGTLinkIF to an extension would make sense.

---

<div class="post-metadata">

**Author:** ![tokjun](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tokjun/32/1057_2.png) [@tokjun](https://discourse.slicer.org/u/tokjun)\
**Post date:** [January 16, 2018, 2:29pm UTC](https://discourse.slicer.org/t/video-compression-in-slicer-core/1846/7 "2018-01-16T14:29:14Z")

</div>

As for the IGT category, I remember that we created and kept OpenIGTLinkIF there as a default module because we wanted to make the IGT activities visible in the Slicer community. But that was when we had a lot more default modules in 3D Slicer. Now the users are expected to install extensions almost any type of research and I think the visibility in the default menu became less important.

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [January 16, 2018, 3:01pm UTC](https://discourse.slicer.org/t/video-compression-in-slicer-core/1846/8 "2018-01-16T15:01:20Z")

</div>

Should the extension be named `OpenIGTLink` and bundled both `OpenIGTLink` and `OpenIGTLinkIF` ?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [January 16, 2018, 3:29pm UTC](https://discourse.slicer.org/t/video-compression-in-slicer-core/1846/9 "2018-01-16T15:29:13Z")

</div>

I agree, OpenIGTLink as extension name sounds good (maybe SlicerOpenIGTLink? but I think OpenIGTLink is enough). Repository name should be SlicerOpenIGTLink to make it clear in GitHub that this is a Slicer extension.

It would build OpenIGTLink and OpenIGTLinkIO libraries using superbuild.

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [January 16, 2018, 3:32pm UTC](https://discourse.slicer.org/t/video-compression-in-slicer-core/1846/10 "2018-01-16T15:32:26Z")

</div>

Great.

Could someone create the repo `SlicerOpenIGTLink` in [https://github.com/openigtlink](https://github.com/openigtlink) ? (Or should it be hosted in the `Slicer` organization ?)

---

<div class="post-metadata">

**Author:** ![leochan2009](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/leochan2009/32/519_2.png) [@leochan2009](https://discourse.slicer.org/u/leochan2009)\
**Post date:** [January 16, 2018, 4:37pm UTC](https://discourse.slicer.org/t/video-compression-in-slicer-core/1846/11 "2018-01-16T16:37:08Z")

</div>

Hi Jean,

I will make a repo in [https://github.com/openigtlink](https://github.com/openigtlink), which i am currently maintaining and have full access to it.  
Once the video codec is added into the Slicer core, OpenIGTLink library will be able to link to the codec libraries and video streaming would be available in Slicer.

Best,  
Longquan

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [January 16, 2018, 6:24pm UTC](https://discourse.slicer.org/t/video-compression-in-slicer-core/1846/12 "2018-01-16T18:24:40Z")

</div>

> [@leochan2009](#):
>
> I will make a repo in [OpenIGTLink · GitHub](https://github.com/openigtlink)

Great, the consider giving push access to the following user: `@jcfr @lassoan @pieper @ungi`

> [@leochan2009](#):
>
> Once the video codec is added into the Slicer core

After we create `SlicerOpenIGTLink` extension, how would we integrate the video codec ?

Should we also consider a `SlicerVideoCodec` extension ?

---

<div class="post-metadata">

**Author:** ![leochan2009](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/leochan2009/32/519_2.png) [@leochan2009](https://discourse.slicer.org/u/leochan2009)\
**Post date:** [January 16, 2018, 6:56pm UTC](https://discourse.slicer.org/t/video-compression-in-slicer-core/1846/13 "2018-01-16T18:56:08Z")

</div>

SlicerVideoCodec could be a solution. The OpenH264 codec provides a link for binary download:

> **[Releases · cisco/openh264](https://github.com/cisco/openh264/releases)**
>
> Open Source H.264 Codec . Contribute to cisco/openh264 development by creating an account on GitHub.

So we should be able to trigger the download in the SlicerVideoCodec extension.  
Regarding the other codecs, i am not sure what would be the best method to integrate into slicer.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [January 16, 2018, 8:27pm UTC](https://discourse.slicer.org/t/video-compression-in-slicer-core/1846/14 "2018-01-16T20:27:35Z")

</div>

We should probably add an abstract interface for video compression (and maybe also a trivial uncompressed storage class) into Slicer core and implement interface to register/unregister codecs, similarly to displayable managers.

---

<div class="post-metadata">

**Author:** ![franklinwk](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/franklinwk/32/862_2.png) [@franklinwk](https://discourse.slicer.org/u/franklinwk)\
**Post date:** [January 18, 2018, 3:33pm UTC](https://discourse.slicer.org/t/video-compression-in-slicer-core/1846/15 "2018-01-18T15:33:55Z")

</div>

From a user perspective I think there may be situations where OpenIGTLink is essential and expected despite access to the extension server being limited. Would it make sense to package a Slicer binary with “core extensions” along with a Slicer “Lite” without any?

---

<div class="post-metadata">

**Author:** ![ungi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ungi/32/78573_2.png) [@ungi](https://discourse.slicer.org/u/ungi)\
**Post date:** [January 19, 2018, 3:13am UTC](https://discourse.slicer.org/t/video-compression-in-slicer-core/1846/16 "2018-01-19T03:13:28Z")

</div>

There are two sides of this issue. If we don’t put OpenIGTLinkIF into an extension, it would be hard to add compressed video support. Not having compressed video is a blocking issue in many projects. On the other hand installing OpenIGTLinkIF from the extension manager or building a custom Slicer packaged with it already is not a impossible thing to do. For the sake of compressed video, I think we should go ahead with the extension plan.

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [January 19, 2018, 3:33pm UTC](https://discourse.slicer.org/t/video-compression-in-slicer-core/1846/17 "2018-01-19T15:33:05Z")

</div>

> [@ungi](#):
>
> think we should go ahead with the extension plan.

@leochan2009 is making good progress. See [GitHub - openigtlink/SlicerOpenIGTLink: OpenIGTLinkIF module as an Slicer Extension](https://github.com/openigtlink/SlicerOpenIGTLink)

@leochan2009 Let me know if you need help removing the OpenIGTLink build options from Slicer build system.

---

<div class="post-metadata">

**Author:** ![leochan2009](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/leochan2009/32/519_2.png) [@leochan2009](https://discourse.slicer.org/u/leochan2009)\
**Post date:** [January 19, 2018, 4:29pm UTC](https://discourse.slicer.org/t/video-compression-in-slicer-core/1846/18 "2018-01-19T16:29:45Z")

</div>

Hi All,

I just create a pull request for SlicerOpenIGTLink extension.  
As the codec is not available in the Slicer core yet, in the extension, VP9 codec is super-built for linux/Mac, however, it is not easy to superbuild VP9 in windows platform, so i trigger the download of binary file from this repository for the window platform:

> **[GitHub - openigtlink/CodecLibrariesFile: Place to stored the compiled codec...](https://github.com/openigtlink/CodecLibrariesFile)**
>
> Place to stored the compiled codec libraries. Contribute to openigtlink/CodecLibrariesFile development by creating an account on GitHub.

Currently i only uploaded the binary file compiled with “Visual Studio 14 2015”. I think Slicer nightly build is using “Visual Studio 12 2013”, am i right? So in windows build Slicer, video streaming will not be available.  
unfortunately, i didn’t find binary distributions from webmproject, would be nice if you guys find binary distrubution for other compilers.

---

<div class="post-metadata">

**Author:** ![leochan2009](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/leochan2009/32/519_2.png) [@leochan2009](https://discourse.slicer.org/u/leochan2009)\
**Post date:** [January 19, 2018, 4:36pm UTC](https://discourse.slicer.org/t/video-compression-in-slicer-core/1846/19 "2018-01-19T16:36:59Z")

</div>

Hi Jean,

I just pull another request to remove the OpenIGTLink from the core. I test the build on my Mac machine, it seems working, would be great if you have a double check.

Best,  
Longquan

---

<div class="post-metadata">

**Author:** ![leochan2009](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/leochan2009/32/519_2.png) [@leochan2009](https://discourse.slicer.org/u/leochan2009)\
**Post date:** [January 21, 2018, 1:53am UTC](https://discourse.slicer.org/t/video-compression-in-slicer-core/1846/20 "2018-01-21T01:53:00Z")

</div>

Hi Jean @jcfr ,

The build of OpenIGTLinkIF extension failed unfortunately:  
[http://slicer.cdash.org/viewBuildError.php?buildid=1181930](http://slicer.cdash.org/viewBuildError.php?buildid=1181930)  
The reason is the version of python interpreter. To build VP9, i current set the python version to be 2.7, however, the slicer build system only have 2.6.5 installed. Please refer the above link for more information.  
Regarding the windows build, the Slicer is building the extension using “Visual Studio 12 2013 Win64”, [http://slicer.cdash.org/buildSummary.php?buildid=1181801](http://slicer.cdash.org/buildSummary.php?buildid=1181801)  
So I think once we have the VP9 library available, we should able to make the build successful. I am working with Andras in this issue. Hopefully will fix it soon.

Best,  
Longquan

[Next page](https://discourse.slicer.org/t/video-compression-in-slicer-core/1846.md?page=2)
