#编者注 先通过达芬奇软件导出标准时间线(所导出的AAF文件Hiero软件可用),再通过pyaaf/examples/dump.py去读取onlyone.aaf文件,对文件进行操作,实现
#pyaaf读取AAF文件,罗列所有元素
使用pyaaf的dump工具查看AAF文件
python pyaaf-0.9.0\example\dump.py pyaaf_test\resources\onlyone.aaf
达芬奇输出的时间线上只有一个视频的例子的内容打印
D:\ZhanPeng\Workspace\Python\pyaaf>python pyaaf-0.9.0\example\dump.py resources\onlyone.aaf
ByteOrder 18761
LastModified 2016-08-12 03:08:58.00
Content <aaf.storage.ContentStorage at 0x2c14300>
Mobs <aaf.iterator.PropValueResolveIter object at 0x02BE7B70>
Timeline 1 <aaf.mob.CompositionMob Timeline 1 urn:smpte:umid:060a2b34.01010101.01010f00.13000000.060e2b34.7f7f2a80.57ad3dca.61640018 at 0x2c1a660>
MobID urn:smpte:umid:060a2b34.01010101.01010f00.13000000.060e2b34.7f7f2a80.57ad3dca.61640018
Name Timeline 1
Slots <aaf.iterator.PropValueResolveIter object at 0x02C082B0>
<aaf.mob.TimelineMobSlot at 0x2c1a6b8>
SlotID 1
SlotName
Segment <aaf.component.Timecode at 0x2c1a710>
DataDefinition <aaf.define.DataDef DataDef_Timecode at 0x2c14530>
Identification urn:uuid:01030201-0100-0000-060e-2b3404010101
Name DataDef_Timecode
Description Timecode data
Length 297
Start 86400
FPS 24
Drop False
PhysicalTrackNumber 1
EditRate 24
Origin 0
<aaf.mob.TimelineMobSlot at 0x2c1a710>
SlotID 2
SlotName
Segment <aaf.component.Sequence at 0x2c1a6b8>
DataDefinition <aaf.define.DataDef DataDef_Picture at 0x2c14530>
Identification urn:uuid:01030202-0100-0000-060e-2b3404010101
Name DataDef_Picture
Description Picture data
Length 297
Components <aaf.iterator.PropValueResolveIter object at 0x02BE0198>
<aaf.component.Filler at 0x2c1a768>
DataDefinition <aaf.define.DataDef DataDef_Picture at 0x2c14530>
Identification urn:uuid:01030202-0100-0000-060e-2b3404010101
Name DataDef_Picture
Description Picture data
Length 52
<aaf.component.OperationGroup at 0x2c1a7c0>
DataDefinition <aaf.define.DataDef DataDef_Picture at 0x2c14530>
Identification urn:uuid:01030202-0100-0000-060e-2b3404010101
Name DataDef_Picture
Description Picture data
Length 245
Operation <aaf.define.OperationDef Motion Control at 0x2c14530>
Identification urn:uuid:9d2ea890-0968-11d3-8a38-0050040ef7d2
Name Motion Control
Description Motion Control
DataDefinition <aaf.define.DataDef DataDef_Picture at 0x2c14ad0>
Identification urn:uuid:01030202-0100-0000-060e-2b3404010101
Name DataDef_Picture
Description Picture data
IsTimeWarp True
OperationCategory OperationCategory_Effect
NumberInputs 1
ParametersDefined <aaf.iterator.PropValueResolveIter object at 0x02C3E030>
SpeedRatio <aaf.define.ParameterDef SpeedRatio at 0x2c14ad0>
Identification urn:uuid:72559a80-24d7-11d3-8a50-0050040ef7d2
Name SpeedRatio
Description Speed Ratio
Type <aaf.define.TypeDefRecord object at 0x02C3F0F0>
InputSegments <aaf.iterator.PropValueResolveIter object at 0x02BE0080>
<aaf.component.SourceClip at 0x2c1a768>
DataDefinition <aaf.define.DataDef DataDef_Picture at 0x2c14530>
Identification urn:uuid:01030202-0100-0000-060e-2b3404010101
Name DataDef_Picture
Description Picture data
Length 306
SourceID urn:smpte:umid:060a2b34.01010101.01010f00.13000000.060e2b34.7f7f2a80.57ad3dca.61650018
SourceMobSlotID 1
StartTime 0
Parameters <aaf.iterator.PropValueResolveIter object at 0x02BE0080>
SpeedRatio <aaf.component.ConstantValue SpeedRatio at 0x2c14530>
Definition urn:uuid:72559a80-24d7-11d3-8a50-0050040ef7d2
Value 245/306
PhysicalTrackNumber 1
EditRate 24
Origin 0
<aaf.mob.TimelineMobSlot at 0x2c1a6b8>
SlotID 3
SlotName
Segment <aaf.component.Sequence at 0x2c1a710>
DataDefinition <aaf.define.DataDef DataDef_Sound at 0x2c14530>
Identification urn:uuid:01030202-0200-0000-060e-2b3404010101
Name DataDef_Sound
Description Sound data
Length 297
Components <aaf.iterator.PropValueResolveIter object at 0x02C17A30>
<aaf.component.Filler at 0x2c1a7c0>
DataDefinition <aaf.define.DataDef DataDef_Sound at 0x2c14530>
Identification urn:uuid:01030202-0200-0000-060e-2b3404010101
Name DataDef_Sound
Description Sound data
Length 52
<aaf.component.OperationGroup at 0x2c1a768>
DataDefinition <aaf.define.DataDef DataDef_Sound at 0x2c14530>
Identification urn:uuid:01030202-0200-0000-060e-2b3404010101
Name DataDef_Sound
Description Sound data
Length 245
Operation <aaf.define.OperationDef Audio Channel Combiner at 0x2c14530>
Identification urn:uuid:6b46dd7a-132d-4856-ab21-8b751d8462ec
Name Audio Channel Combiner
Description Audio Channel Combiner
DataDefinition <aaf.define.DataDef DataDef_Sound at 0x2c14ad0>
Identification urn:uuid:01030202-0200-0000-060e-2b3404010101
Name DataDef_Sound
Description Sound data
IsTimeWarp False
OperationCategory OperationCategory_Effect
NumberInputs 1
InputSegments <aaf.iterator.PropValueResolveIter object at 0x02BE0300>
<aaf.component.SourceClip at 0x2c1a7c0>
DataDefinition <aaf.define.DataDef DataDef_Sound at 0x2c14530>
Identification urn:uuid:01030202-0200-0000-060e-2b3404010101
Name DataDef_Sound
Description Sound data
Length 306
SourceID urn:smpte:umid:060a2b34.01010101.01010f00.13000000.060e2b34.7f7f2a80.57ad3dca.61650018
SourceMobSlotID 2
StartTime 0
<aaf.component.SourceClip at 0x2c1a818>
DataDefinition <aaf.define.DataDef DataDef_Sound at 0x2c14530>
Identification urn:uuid:01030202-0200-0000-060e-2b3404010101
Name DataDef_Sound
Description Sound data
Length 306
SourceID urn:smpte:umid:060a2b34.01010101.01010f00.13000000.060e2b34.7f7f2a80.57ad3dca.61650018
SourceMobSlotID 2
StartTime 0
PhysicalTrackNumber 1
EditRate 24
Origin 0
TimelineMobAttributeList <aaf.iterator.PropValueResolveIter object at 0x02C179E0>
_TRACK_FORMAT <aaf.property.TaggedValue _TRACK_FORMAT at 0x2c14530>
Name _TRACK_FORMAT
Value 2
LastModified 2016-08-12 03:08:58.00
CreationTime 2016-08-12 03:08:58.00
UsageCode Usage_TopLevel
IMG_3713 <aaf.mob.MasterMob IMG_3713 urn:smpte:umid:060a2b34.01010101.01010f00.13000000.060e2b34.7f7f2a80.57ad3dca.61650018 at 0x2bad630>
MobID urn:smpte:umid:060a2b34.01010101.01010f00.13000000.060e2b34.7f7f2a80.57ad3dca.61650018
Name IMG_3713
Slots <aaf.iterator.PropValueResolveIter object at 0x02C0E850>
<aaf.mob.TimelineMobSlot at 0x2c1a660>
SlotID 1
SlotName
Segment <aaf.component.SourceClip at 0x2c1a6b8>
DataDefinition <aaf.define.DataDef DataDef_Picture at 0x2c14530>
Identification urn:uuid:01030202-0100-0000-060e-2b3404010101
Name DataDef_Picture
Description Picture data
Length 307
SourceID urn:smpte:umid:060a2b34.01010101.01010f00.13000000.060e2b34.7f7f2a80.57ad3dca.61660018
SourceMobSlotID 1
StartTime 0
PhysicalTrackNumber 1
EditRate 30
Origin 0
<aaf.mob.TimelineMobSlot at 0x2c1a6b8>
SlotID 2
SlotName
Segment <aaf.component.SourceClip at 0x2c1a660>
DataDefinition <aaf.define.DataDef DataDef_Sound at 0x2c14530>
Identification urn:uuid:01030202-0200-0000-060e-2b3404010101
Name DataDef_Sound
Description Sound data
Length 307
SourceID urn:smpte:umid:060a2b34.01010101.01010f00.13000000.060e2b34.7f7f2a80.57ad3dca.61680018
SourceMobSlotID 1
StartTime 0
PhysicalTrackNumber 1
EditRate 30
Origin 0
LastModified 2016-08-12 03:08:58.00
CreationTime 2016-08-12 03:08:58.00
IMG_3713 <aaf.mob.SourceMob IMG_3713 urn:smpte:umid:060a2b34.01010101.01010f00.13000000.060e2b34.7f7f2a80.57ad3dca.61660018 at 0x2c1a6b8>
MobID urn:smpte:umid:060a2b34.01010101.01010f00.13000000.060e2b34.7f7f2a80.57ad3dca.61660018
Name IMG_3713
Slots <aaf.iterator.PropValueResolveIter object at 0x02C32FD0>
<aaf.mob.TimelineMobSlot at 0x2c1a660>
SlotID 1
SlotName
Segment <aaf.component.SourceClip at 0x2c1a710>
DataDefinition <aaf.define.DataDef DataDef_Picture at 0x2c14530>
Identification urn:uuid:01030202-0100-0000-060e-2b3404010101
Name DataDef_Picture
Description Picture data
Length 307
SourceID urn:smpte:umid:060a2b34.01010101.01010f00.13000000.060e2b34.7f7f2a80.57ad3dca.61670018
SourceMobSlotID 2
StartTime 0
PhysicalTrackNumber 1
EditRate 30
Origin 0
LastModified 2016-08-12 03:08:58.00
CreationTime 2016-08-12 03:08:58.00
EssenceDescription <aaf.essence.CDCIDescriptor at 0x2c1a660>
Locator <aaf.iterator.PropValueResolveIter object at 0x02C176C0>
<aaf.essence.NetworkLocator at 0x2c14530>
URLString file:///D:/ZhanPeng/Source/IMG_3713.mov
SampleRate 30
Length 307
StoredHeight 1080
StoredWidth 1920
FrameLayout FullFrame
VideoLineMap <aaf.iterator.PropValueResolveIter object at 0x02C176C0>
0
1
ImageAspectRatio 1920/1080
ComponentWidth 8
HorizontalSubsampling 2
FrameSampleSize 4147200
<aaf.mob.SourceMob urn:smpte:umid:060a2b34.01010101.01010f00.13000000.060e2b34.7f7f2a80.57ad3dca.61670018 at 0x2c1a660>
MobID urn:smpte:umid:060a2b34.01010101.01010f00.13000000.060e2b34.7f7f2a80.57ad3dca.61670018
Name
Slots <aaf.iterator.PropValueResolveIter object at 0x02C32FD0>
<aaf.mob.TimelineMobSlot at 0x2c1a6b8>
SlotID 1
SlotName
Segment <aaf.component.Timecode at 0x2c1a710>
DataDefinition <aaf.define.DataDef DataDef_Timecode at 0x2c14530>
Identification urn:uuid:01030201-0100-0000-060e-2b3404010101
Name DataDef_Timecode
Description Timecode data
Length 307
Start 0
FPS 30
Drop False
PhysicalTrackNumber 1
EditRate 30
Origin 0
<aaf.mob.TimelineMobSlot at 0x2c1a710>
SlotID 2
SlotName
Segment <aaf.component.SourceClip at 0x2c1a6b8>
DataDefinition <aaf.define.DataDef DataDef_Picture at 0x2c14530>
Identification urn:uuid:01030202-0100-0000-060e-2b3404010101
Name DataDef_Picture
Description Picture data
Length 307
SourceID urn:smpte:umid:00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000
SourceMobSlotID 0
StartTime 0
PhysicalTrackNumber 1
EditRate 30
Origin 0
LastModified 2016-08-12 03:08:58.00
CreationTime 2016-08-12 03:08:58.00
EssenceDescription <aaf.essence.TapeDescriptor at 0x2c14530>
IMG_3713 <aaf.mob.SourceMob IMG_3713 urn:smpte:umid:060a2b34.01010101.01010f00.13000000.060e2b34.7f7f2a80.57ad3dca.61680018 at 0x2c1a710>
MobID urn:smpte:umid:060a2b34.01010101.01010f00.13000000.060e2b34.7f7f2a80.57ad3dca.61680018
Name IMG_3713
Slots <aaf.iterator.PropValueResolveIter object at 0x02C082B0>
<aaf.mob.TimelineMobSlot at 0x2c1a660>
SlotID 1
SlotName
Segment <aaf.component.SourceClip at 0x2c1a6b8>
DataDefinition <aaf.define.DataDef DataDef_Sound at 0x2c14530>
Identification urn:uuid:01030202-0200-0000-060e-2b3404010101
Name DataDef_Sound
Description Sound data
Length 307
SourceID urn:smpte:umid:060a2b34.01010101.01010f00.13000000.060e2b34.7f7f2a80.57ad3dca.61690018
SourceMobSlotID 2
StartTime 0
PhysicalTrackNumber 1
EditRate 30
Origin 0
LastModified 2016-08-12 03:08:58.00
CreationTime 2016-08-12 03:08:58.00
EssenceDescription <aaf.essence.PCMDescriptor at 0x2c1a660>
Locator <aaf.iterator.PropValueResolveIter object at 0x02C179E0>
<aaf.essence.NetworkLocator at 0x2c14530>
URLString file:///D:/ZhanPeng/Source/IMG_3713.mov
SampleRate 48000
Length 491200
QuantizationBits 16
AudioSamplingRate 48000
Channels 1
AverageBPS 96000
BlockAlign 2
<aaf.mob.SourceMob urn:smpte:umid:060a2b34.01010101.01010f00.13000000.060e2b34.7f7f2a80.57ad3dca.61690018 at 0x2c1a660>
MobID urn:smpte:umid:060a2b34.01010101.01010f00.13000000.060e2b34.7f7f2a80.57ad3dca.61690018
Name
Slots <aaf.iterator.PropValueResolveIter object at 0x02C32FD0>
<aaf.mob.TimelineMobSlot at 0x2c1a710>
SlotID 1
SlotName
Segment <aaf.component.Timecode at 0x2c1a6b8>
DataDefinition <aaf.define.DataDef DataDef_Timecode at 0x2c14530>
Identification urn:uuid:01030201-0100-0000-060e-2b3404010101
Name DataDef_Timecode
Description Timecode data
Length 307
Start 0
FPS 30
Drop False
PhysicalTrackNumber 1
EditRate 30
Origin 0
<aaf.mob.TimelineMobSlot at 0x2c1a6b8>
SlotID 2
SlotName
Segment <aaf.component.SourceClip at 0x2c1a710>
DataDefinition <aaf.define.DataDef DataDef_Sound at 0x2c14530>
Identification urn:uuid:01030202-0200-0000-060e-2b3404010101
Name DataDef_Sound
Description Sound data
Length 307
SourceID urn:smpte:umid:00000000.00000000.00000000.00000000.00000000.00000000.00000000.00000000
SourceMobSlotID 0
StartTime 0
PhysicalTrackNumber 1
EditRate 30
Origin 0
LastModified 2016-08-12 03:08:58.00
CreationTime 2016-08-12 03:08:58.00
EssenceDescription <aaf.essence.TapeDescriptor at 0x2c14530>
Dictionary <aaf.dictionary.Dictionary at 0x2c1a660>
Version {u'major': 1, u'minor': 1}
IdentificationList <aaf.iterator.PropValueResolveIter object at 0x02C32FD0>
<aaf.storage.Identification at 0x2c14300>
CompanyName Blackmagic Design
ProductName DaVinci Resolve
ProductVersion {u'major': 12, u'type': u'VersionReleased', u'tertiary': 0, u'minor': 5, u'patchLevel': 0}
ProductVersionString Unknown version
ProductID urn:uuid:00000018-0000-0000-178d-3d5f00000000
Date 2016-08-12 03:08:58.00
ToolkitVersion {u'major': 1, u'type': u'VersionReleased', u'tertiary': 6, u'minor': 1, u'patchLevel': 0}
Platform AAFSDK (Win32)
GenerationAUID urn:uuid:e82b9fd4-2e3a-4ae3-802f-18368b60530d
ObjectModelVersion 1
D:\ZhanPeng\Workspace\Python\pyaaf>
#备注:使用 Davinci Resolve 12.5导出AAF文件
项目选择界面
空项目
时间线操作界面
导出AAF文件
来源:oschina
链接:https://my.oschina.net/u/52678/blog/731646