Skip to content

Commit 8dc9276

Browse files
committed
update readme with description, quickstart, contribution details
1 parent 66d303d commit 8dc9276

File tree

1 file changed

+143
-1
lines changed

1 file changed

+143
-1
lines changed

README.md

Lines changed: 143 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,144 @@
11
# aftereffects-aep-parser
2-
An unofficial parser for Adobe After Effects *.aep project files
2+
3+
This project is dedicated to reverse-engineering, parsing and exposing useful APIs for understanding Adobe After Effects AEP project files. This may be useful for a variety of reasons. For example, one might want to programmatically determine the number of compositions in a project, their resolution(s), framerate, etc. Traditionally, one would need to piggyback the ExtendScript engine running within After Effects to retrieve this information. While this procedure is fairly easy to accomplish, it is exponentially more resource expensive than static file analysis, and requires a running instance of the After Effects Scripting Engine (which can only be run on Windows and MacOS).
4+
5+
# Quick Start
6+
7+
```bash
8+
go get -u github.com/boltframe/aftereffects-aep-parser
9+
```
10+
11+
```go
12+
package main
13+
14+
import (
15+
"fmt"
16+
aep "github.com/boltframe/aftereffects-aep-parser"
17+
)
18+
19+
func main() {
20+
project, err := aep.Open("./my-project.aep")
21+
if err != nil {
22+
panic(err)
23+
}
24+
fmt.Println(project)
25+
}
26+
```
27+
28+
# Contributing
29+
30+
Any and all contributions are welcome! There is no official procedure for contributing yet, but please start by opening a new issue describing your findings and anticipated contribution. Thank you!
31+
32+
# Research Procedure
33+
34+
After Effects Project files are currently encoded using the Resource Interchange File Format (RIFF) in a Big-Endian byte-ordering (also known as RIFX). This can be confirmed by inspecting the first four bytes of any AEP file which will contain the following ASCII characters: `RIFX....`. Once parsed into [Chunks](https://en.wikipedia.org/wiki/Resource_Interchange_File_Format#Explanation), you can inspect the internal representation and *attempt* to understand its structure.
35+
36+
I have found that the online tool [Kaitai](https://ide.kaitai.io) is extremely helpful for quickly viewing structured binary data. I use the following (possibly outdated) language definition for validating AEP files:
37+
38+
```ksy
39+
meta:
40+
id: aep
41+
endian: be
42+
file-extension: aep
43+
44+
seq:
45+
- id: magic1
46+
contents: RIFX
47+
- id: file_size
48+
type: u4
49+
- id: magic2
50+
contents: Egg!
51+
- id: data
52+
type: blocks
53+
size: file_size - 4
54+
55+
types:
56+
blocks:
57+
seq:
58+
- id: entries
59+
type: block
60+
repeat: eos
61+
block:
62+
seq:
63+
- id: block_type
64+
type: u4
65+
enum: chunk_type
66+
- id: block_size
67+
type: u4
68+
- id: data
69+
size: block_size
70+
type:
71+
switch-on: block_type
72+
cases:
73+
'chunk_type::list': list_body
74+
'chunk_type::utf8': utf8_body
75+
'chunk_type::cdta': cdta_body
76+
'chunk_type::idta': idta_body
77+
'chunk_type::cmta': utf8_body
78+
'chunk_type::fdta': fdta_body
79+
_: ascii_body
80+
- id: padding
81+
type: u1
82+
if: (block_size % 2) != 0
83+
list_body:
84+
seq:
85+
- id: identifier
86+
type: str
87+
encoding: ascii
88+
size: 4
89+
- id: entries
90+
type: blocks
91+
utf8_body:
92+
seq:
93+
- id: data
94+
type: str
95+
encoding: utf8
96+
size-eos: true
97+
ascii_body:
98+
seq:
99+
- id: data
100+
type: str
101+
encoding: ascii
102+
size-eos: true
103+
idta_body:
104+
seq:
105+
- id: unknown1
106+
type: str
107+
size: 18
108+
encoding: ascii
109+
- id: id
110+
type: u2
111+
fdta_body:
112+
seq:
113+
- id: unknown1
114+
type: str
115+
encoding: ascii
116+
size: 1
117+
cdta_body:
118+
seq:
119+
- id: unknown1
120+
type: str
121+
size: 140
122+
encoding: ascii
123+
- id: width
124+
type: u2
125+
- id: height
126+
type: u2
127+
- id: unknown2
128+
type: str
129+
size: 12
130+
encoding: ascii
131+
- id: frame_rate
132+
type: u2
133+
134+
enums:
135+
chunk_type:
136+
0x4c495354: list
137+
0x55746638: utf8
138+
0x63647461: cdta # Composition data
139+
0x69647461: idta # Item data
140+
0x636d7461: cmta # Comment data
141+
0x66647461: fdta # Folder data
142+
```
143+
144+
By making small changes to an After Effects project and uploading it to the Kaitai viewer, you can narrow down on how data is represented, and start to write additional language definitions and structures.

0 commit comments

Comments
 (0)