# Interlacing frames from videos

**URL:** <https://discourse.julialang.org/t/interlacing-frames-from-videos/26152>\
**Category:** Visualization\
**Created:** [July 8, 2019, 8:07pm UTC](https://discourse.julialang.org/t/interlacing-frames-from-videos/26152 "2019-07-08T20:07:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [July 8, 2019, 8:07pm UTC](https://discourse.julialang.org/t/interlacing-frames-from-videos/26152/1 "2019-07-08T20:07:56Z")

</div>

**TL,DR:** This is a call for help to improve de-interlacing in `VideoIO`.

Thanks to @ianshmean, `VideoIO` has received a large number of significant improvements lately. These changes make `VideoIO` a viable tool for reading and writing videos. There is however a few remaining issues to deal with. One of them is [interlacing](http://100fps.com/). Here is a MWE:

```julia
import FileIO, VideoIO
file = download("https://s3.eu-central-1.amazonaws.com/vision-group-file-sharing/Data%20backup%20and%20storage/Yakir/interlacing.mkv")
f = VideoIO.openvideo(file)
img = VideoIO.read(f)
FileIO.save("interlacing.jpg", img)

```

While a closeup of the extracted image looks like this:  
 ![](https://global.discourse-cdn.com/julialang/original/3X/a/5/a53abc06f54b40b3e0b21b97514859f94668646b.jpeg)  
`ffmpeg` manages to remedy the artifact with its `yadif` filter:

```bash
ffmpeg -i interlacing.mkv -vframes 1 -vf yadif interlacing.jpg

```

![](https://global.discourse-cdn.com/julialang/original/3X/8/e/8e4a2dff90649b11c58dd064f77661cd134bd3c1.jpeg)

Can someone please take a look at [this `ffmpeg` filtering example](https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/filtering_video.c) and help us convert it to Julia, similarly to how [`VideoIO`’s examples](https://github.com/JuliaIO/VideoIO.jl/tree/master/examples) are? Alternatively, suggest a simpler way to implement filters?

The relevant `VideoIO` issue is [here](https://github.com/JuliaIO/VideoIO.jl/issues/194).

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![ianshmean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ianshmean/32/216042_2.png) [@ianshmean](https://discourse.julialang.org/u/ianshmean)\
**Post date:** [July 8, 2019, 9:02pm UTC](https://discourse.julialang.org/t/interlacing-frames-from-videos/26152/2 "2019-07-08T21:02:29Z")

</div>

👍🏻As I mentioned on slack, I likely won’t have time to take this on. So I’ll just say that I learned from @kevin.squire that the best way to tackle new ffmpeg features is to convert the c examples.

As an example, [https://github.com/JuliaIO/VideoIO.jl/blob/master/examples/encodevideo.jl](https://github.com/JuliaIO/VideoIO.jl/blob/master/examples/encodevideo.jl) is the conversion of [FFmpeg: encode\_video.c](https://www.ffmpeg.org/doxygen/trunk/encode_video_8c-example.html)
