-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate-xml.js
64 lines (61 loc) · 3.31 KB
/
generate-xml.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
module.exports = function generateXML({
name = 'Untitled',
desc = '',
width = 1920,
height = 1080,
fps = 30,
par = '1,1',
tracks = 3,
maxRenderQuality = false,
maxBitDepth = false,
allowLinearCompositing = false,
} = {}) {
desc = desc
.replace(/\n/g, ' ')
.replace(/&/g, '&')
const ticksPerSecond = 254016000000
const ticksPerFrame = ticksPerSecond / fps
return `<?xml version="1.0" encoding="UTF-8"?>
<PremiereData Version="3">
<SequencePreset ObjectRef="1"/>
<SequencePreset ObjectID="1" ClassID="5e73dd7e-4f86-4917-80eb-08ddb2f4a5f3" Version="9">
<SequenceGraphicsWhite>100</SequenceGraphicsWhite>
<SequenceWorkingColorSpace>{"workingSpaceConfigVersion":1,"workingSpaceID":"BT.709 RGB Full","workingSpaceIsLinearized":0}</SequenceWorkingColorSpace>
<PreviewVideoFrameSize>0,0,${width},${height}</PreviewVideoFrameSize>
<ImmersiveVideoVRConfiguration>{"ambisonicsHRIR":"","ambisonicsMonitoringType":0,"capturedHorizontalView":0,"capturedVerticalView":0,"fieldOfHorizontalView":108,"fieldOfVerticalView":108,"projectionType":0,"stereoscopicEye":0,"stereoscopicType":0,"version":3}</ImmersiveVideoVRConfiguration>
<VideoTracks>[]</VideoTracks>
<AudioTracks>[{"mAssign":0,"mAudioSends":[],"mChannelType":1,"mExpandedHeight":25,"mIsOpen":false,"mIsSubmix":false,"mKeyframeMode":true,"mLocked":false,"mMatrix":[],"mMute":false,"mName":"","mPan":0,"mPannerAssignments":[],"mSolo":false,"mSyncLock":true,"mTargeted":false,"mTrackID":-1,"mVolume":1}]</AudioTracks>
<InitialNumberOfVideoTracks>${tracks}</InitialNumberOfVideoTracks>
<AdaptiveNumChannels>2</AdaptiveNumChannels>
<VideoAllowLinearCompositing>${allowLinearCompositing}</VideoAllowLinearCompositing>
<VideoUseMaxRenderQuality>${maxRenderQuality}</VideoUseMaxRenderQuality>
<VideoUseMaxBitDepth>${maxBitDepth}</VideoUseMaxBitDepth>
<VideoPixelAspectRatio>${par}</VideoPixelAspectRatio>
<PreviewPresetVideoCodec.Win>1297107278</PreviewPresetVideoCodec.Win>
<PreviewPresetFileName.Win>I-Frame Only MPEG</PreviewPresetFileName.Win>
<PreviewPresetVideoCodec.Mac>1297107278</PreviewPresetVideoCodec.Mac>
<PreviewPresetFileName.Mac>I-Frame Only MPEG</PreviewPresetFileName.Mac>
<EditingModeGUID.Win>795454d9-d3c2-429d-9474-923ab13b7018</EditingModeGUID.Win>
<EditingModeGUID.Mac>795454d9-d3c2-429d-9474-923ab13b7018</EditingModeGUID.Mac>
<Descriptions Version="1">
<DescriptionItem Version="1" Index="0">
<Second>${desc}</Second>
<First>en_US</First>
</DescriptionItem>
</Descriptions>
<Names Version="1">
<NameItem Version="1" Index="0">
<Second>${name}</Second>
<First>en_US</First>
</NameItem>
</Names>
<VideoFieldType>0</VideoFieldType>
<AudioTimeDisplay>200</AudioTimeDisplay>
<VideoTimeDisplay>104</VideoTimeDisplay>
<AudioChannelType>1</AudioChannelType>
<AudioFrameRate>5292000</AudioFrameRate>
<VideoFrameSize>0,0,${width},${height}</VideoFrameSize>
<VideoFrameRate>${ticksPerFrame}</VideoFrameRate>
</SequencePreset>
</PremiereData>`
}