Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

32-bit float data from hero6.raw #156

Open
bcardarella opened this issue May 6, 2022 · 8 comments
Open

32-bit float data from hero6.raw #156

bcardarella opened this issue May 6, 2022 · 8 comments

Comments

@bcardarella
Copy link

Towards the end of the hero6.raw sample file there are a few chunks of data that identify of type 'f' for a 32-bit float but the size is 12 with a repeat of 30. For a 32-bit float the size should be 4. Or is there something I'm missing here?

@bcardarella
Copy link
Author

I'm actually, seeing this for other types as well. The s type which should be a 16-bit signed integer, so 2 bytes has a size of 6 instead with a repeat of 204.

@dnewman-gpsw
Copy link
Collaborator

This is correct, as it describes the array size. So float [][3] would be type 'f' with a size 12. short [][3] is type 's' with size 6.

@bcardarella
Copy link
Author

@dnewman-gpsw ah, so an array of arrays?

@dnewman-gpsw
Copy link
Collaborator

Yes. The repeat is the number on time entries. So GPMF is always in form type[repeat][typesize/sizeof(type)] e.g. float[repeat][typesize/sizeof(float)]

@bcardarella
Copy link
Author

What about char values? Do those remain as two-dimensional array?

@dnewman-gpsw
Copy link
Collaborator

No 1D, generally you will typesize = strlen("the string"), and a repeat of 1. On the earliest cameras this was reverse, but still 1D. The only common acception, but still following or the rules. SUIN/UNIT fields can have a 2D array of chars, which is 1D arrary of fixed length strings.

@bcardarella
Copy link
Author

bcardarella commented May 6, 2022

@dnewman-gpsw I'm seeing in the hero6.raw file that I get ['c', 1, 0, 50] for the length segment. In this case I was reading this as a <type><size><repeat> but your comment is saying the order should be reversed? Or is the hero6 of that older format?

@ghost
Copy link

ghost commented May 9, 2022

@bcardarella See this thread for ideas:
#143

I "convert" all 'c' streams as if it had repeats 1 before parsing as a string (switching place of size and repeat if necessary).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants