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

Feature request: Start offset, Playhead position, Start Frame, End Frame #1

Open
LilyStilson opened this issue Jan 30, 2021 · 2 comments

Comments

@LilyStilson
Copy link

your work is awesome!

Using some hex comparers and editors I discovered where exactly in cdta composition start offset, playhead current frame, composition start frame and composition end frame are stored.

ae_hex

Skipping some bytes after cdta header, there is something stored there with lot's of empty space until Width and Height (pos: 2D0, at [0A, 0B, 0C, 0D]), probably reserved for large values, since all this stored as Frame * 2. I have no idea why it is stored as a multiply of 2, but that's how it is.

So, if it possible, could you please implement this fields for compositions? This would really help me with reading AEP files completely separately from AE.

Also, modifying corresponding values results in a modification of composition, which shown here: YouTube

@rioam2
Copy link
Contributor

rioam2 commented Jan 31, 2021

I'm glad this utility has been useful for you! It's interesting how these values are multiplied by 2. Good discovery. I've found that some other values (namely framerate) are stored as a quotient of two numbers: dividend and divisor to yield the final value. Maybe this is similar? (framerate calculation:

item.FootageFramerate = float64(compDesc.FramerateDividend) / float64(compDesc.FramerateDivisor)
)

I suspect that these new values you've discovered can be easily inserted into the following structure at the proper offsets:

type CDTA struct {
The Unknown## fields are just padding at the moment, so these new fields would have to be inserted somewhere in between.

I'm a bit occupied with work at the moment, but I would like to get to these edits at some point soon. If you're feeling brave, and want to try and make these additions yourself, I'd be more than happy to review your Pull Request!

Also, regarding writing back to an AEP file, I'll have to do more research, but I believe this is against Adobe's terms of service.

@LilyStilson
Copy link
Author

LilyStilson commented Jan 31, 2021

@rioam2 I modified Item and CDTA struct a bit, and even though, it turned to be a bit ugly:

image
image

It still works like magic:

image

But I think there could be a problem with parsing, if composition has large frame count. I used uint16 instead of uint32, because it will grab additional zero bytes at the end (fields OffsetX_1). Is there any way to overcome this issue?

Also, for the time being, I disabled layers' parsing, so #2 won't happens

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