# Trying to read binary file into struct with julia

**URL:** <https://discourse.julialang.org/t/trying-to-read-binary-file-into-struct-with-julia/16025>\
**Category:** New to Julia\
**Tags:** question, binaryio\
**Created:** [October 8, 2018, 3:23pm UTC](https://discourse.julialang.org/t/trying-to-read-binary-file-into-struct-with-julia/16025 "2018-10-08T15:23:37Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![stillyslalom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stillyslalom/32/45687_2.png) [@stillyslalom](https://discourse.julialang.org/u/stillyslalom)\
**Post date:** [October 10, 2018, 6:23pm UTC](https://discourse.julialang.org/t/trying-to-read-binary-file-into-struct-with-julia/16025/11 "2018-10-10T18:23:55Z")

</div>

I rewrote the reader to allow loading of individual frames: [https://gist.github.com/stillyslalom/36d72c216da18202d018025d3ef28fff](https://gist.github.com/stillyslalom/36d72c216da18202d018025d3ef28fff)

```julia
filename = "test.cine"
vid, header = readcine(filename) # Read the entire video file

# for individual frames:
header = cineheader(filename) # Just the header
img = readframe(filename, header, 1) # Read the first frame

# for sets of frames
subvid1 = readframe(filename, header, 1:10:500) # Read every tenth frame
subvid2 = readframe(filename, header, [1, 7, 42]) # Read arbitrary sets of frames

```

---

_[View the full topic](https://discourse.julialang.org/t/trying-to-read-binary-file-into-struct-with-julia/16025)._
