[aaf-commits] Read AAF file with Python?
From: Joel Pennington <jpennington@im...> - 2008-05-06 16:35
Attachments: HTML-Email.html
Hi, I'm an intermediate Python scripter with no C++ knowledge. If possible I'd like to
parse an AAF file using Python, but I can't seem to find documentation describing the binary
layout of an AAF file. Do you have such documentation, or a Python based parsing tool?
Thank you in advance,
Joel Pennington
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Instead of writing a python parsing tool from scratch you have a couple of other options:
1) Write a python wrapper around the C++ COM API. This should be straightforward and developers have done this for at least one other language, namely Delphi (see http://sourceforge.net/projects/aaf-edit-pack\). You take the main headerfile, AAF.h, and produce bindings for your language, perhaps using an automated tool. You will need the AAFCOAPI.dll available at runtime, which is built from the C++ source, or downloaded from the releases page.
2) Build the aaffmtconv tool from AAF/Utilities/aaffmtconv (see README.TXT for building instructions). Execute this with the -xml option e.g. "aaffmtconv -xml input.aaf output.xml". Parse the XML file with your favorite python xml parser. Note that there are some limitations with the aaffmtconv tool until we release AAF v1.2, but in practice it works well.
Stuart
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
After browsing the forum I ran across this reply that seemed to be the answer I was looking for. I am not fluent in C and can only scape along in VB. But I have a need to work with some aaf files and this seemed to be my answer….
So, I downloaded the WinSDK, called up MS C express, loaded everything and then complied the aaffmntconv project out of there. The I tried to run the program.
This is the result I get:
C:\>aaffmtconv -xml c:\etest c:\ftest
Error '80120021' returned at line 123 in c:\downloads\aaf\aaf-src-1.1.4-dr1\aaf-
src-1.1.4-dr1\utilities\aaffmtconv\aaffmtconv.cpp
In this case etest is a valid Avid aaf, but I also downloaded the example aff files from this site and tried the program on those files and got the exact same result.
Could somebody point me in the right direction to get this file complied? If I can get the data in xml format, I am pretty sure that I can parse out what I need….. or maybe not, but until I get something I can read I will never know. What I want to do is find all of the source clips in master record order. I want the source clips from start of effect in to end of effect out as seperate clips. I need this individually by track (layer). I think that I could get this from the aaf if it were in xml format.
Feel free to tell me that any part of what I am doing is wrong…..or just will not work.
Thanks in advance for any help you can give me.
Joe Ogburn
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Originally posted here: https://sourceforge.net/mailarchive/message.php?msg_name=69ECE34F7A51354CA2C60A7D311C4EAA0220161026%40imd-exchange-01.imagemoversdigital.com
[aaf-commits] Read AAF file with Python?
From: Joel Pennington <jpennington@im...> - 2008-05-06 16:35
Attachments: HTML-Email.html
Hi, I'm an intermediate Python scripter with no C++ knowledge. If possible I'd like to
parse an AAF file using Python, but I can't seem to find documentation describing the binary
layout of an AAF file. Do you have such documentation, or a Python based parsing tool?
Thank you in advance,
Joel Pennington
AAF uses Mirosoft Structured Storage as a stored format.
AAF Low-Level Container Specification v1.0.1:
http://amwa.tv/html/specs/aafcontainerspec-v1.0.1.pdf
AAF Stored Format Specification v1.0.1:
http://amwa.tv/html/specs/aafstoredformatspec-v1.0.1.pdf
Alexey
Instead of writing a python parsing tool from scratch you have a couple of other options:
1) Write a python wrapper around the C++ COM API. This should be straightforward and developers have done this for at least one other language, namely Delphi (see http://sourceforge.net/projects/aaf-edit-pack\). You take the main headerfile, AAF.h, and produce bindings for your language, perhaps using an automated tool. You will need the AAFCOAPI.dll available at runtime, which is built from the C++ source, or downloaded from the releases page.
2) Build the aaffmtconv tool from AAF/Utilities/aaffmtconv (see README.TXT for building instructions). Execute this with the -xml option e.g. "aaffmtconv -xml input.aaf output.xml". Parse the XML file with your favorite python xml parser. Note that there are some limitations with the aaffmtconv tool until we release AAF v1.2, but in practice it works well.
Stuart
Please excuse the non-programer…..
After browsing the forum I ran across this reply that seemed to be the answer I was looking for. I am not fluent in C and can only scape along in VB. But I have a need to work with some aaf files and this seemed to be my answer….
So, I downloaded the WinSDK, called up MS C express, loaded everything and then complied the aaffmntconv project out of there. The I tried to run the program.
This is the result I get:
C:\>aaffmtconv -xml c:\etest c:\ftest
Error '80120021' returned at line 123 in c:\downloads\aaf\aaf-src-1.1.4-dr1\aaf-
src-1.1.4-dr1\utilities\aaffmtconv\aaffmtconv.cpp
In this case etest is a valid Avid aaf, but I also downloaded the example aff files from this site and tried the program on those files and got the exact same result.
Could somebody point me in the right direction to get this file complied? If I can get the data in xml format, I am pretty sure that I can parse out what I need….. or maybe not, but until I get something I can read I will never know. What I want to do is find all of the source clips in master record order. I want the source clips from start of effect in to end of effect out as seperate clips. I need this individually by track (layer). I think that I could get this from the aaf if it were in xml format.
Feel free to tell me that any part of what I am doing is wrong…..or just will not work.
Thanks in advance for any help you can give me.
Joe Ogburn