pyavb icon indicating copy to clipboard operation
pyavb copied to clipboard

avb2aaf errors

Open tin2tin opened this issue 5 years ago • 18 comments

I'm testing a file from Avid First.

In my Avid project folder I have: image

The avb files produce this error: C:\Users\user\pyavb\examples>python avb2aaf.py "C:\Users\user\Documents\MC First Avid Projects\tintwotin\Avid_test\Avid_test Bin.avb" b'BINF' b'464e49427d000000020e040000009da74e5ed93e18000000b7820100000000010000000300416e79010000000300416e79010000000300416e79010000000300416e79010000000300416e79010000000300416e79000003000c0005000100e0fffaff24006a000100004d004d004d010000b300b300b30600030000000002010200000003' Traceback (most recent call last): File "avb2aaf.py", line 798, in <module> avb2aaf_main(sys.argv[1]) File "avb2aaf.py", line 785, in avb2aaf_main with avb.open(path) as avb_file: File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\avb\file.py", line 156, in __init__ self.content = self.read_object(self.root_index) File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\avb\file.py", line 274, in read_object raise NotImplementedError(chunk.class_id) NotImplementedError: b'BINF' And the avp file produce this error: C:\Users\user\pyavb\examples>python avb2aaf.py "C:\Users\user\Documents\MC First Avid Projects\tintwotin\Avid_test\Avid_test.avp" Traceback (most recent call last): File "avb2aaf.py", line 798, in <module> avb2aaf_main(sys.argv[1]) File "avb2aaf.py", line 785, in avb2aaf_main with avb.open(path) as avb_file: File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\avb\file.py", line 136, in __init__ assert ctx.read_fourcc(f) == b'ATob' AssertionError

The project consists of 3 cuts in the same source clip. What am I just doing wrong?

tin2tin avatar Feb 20 '20 16:02 tin2tin

Your not doing anything wrong. BINF types are not implemented because I haven't seen them before. It shouldn't be too hard to add the type, are you able to share the AVB file?

markreidvfx avatar Feb 21 '20 04:02 markreidvfx

Thank you. Here's the project file from Avid First: Avid_test.zip

tin2tin avatar Feb 21 '20 05:02 tin2tin

BINF types have been added in ed996ff469e2b4cde8ba00dcbadfa08af66cf9c5. Seems they are just sub classes of ABIN but with some extra data that I'm not sure what is. I'm not familiar with avid first, if it has a console window perhaps you could help identify what the extra 4 bytes are, using EnableBinXMLDump true. On regular Media composer that saves the bin as a XML representation when the bin is saved.

markreidvfx avatar Feb 22 '20 05:02 markreidvfx

Thank you. I've tried updating: pip install --upgrade pyavb But unsuccessfully, how long time do I have to wait for the update to become available on pip?

According to this link it is not possible to open normal Avid projects in Avid First, which may explain the extra 4 bytes? https://www.premiumbeat.com/blog/review-avids-free-nle-media-composer-first/

Cannot open existing Media Composer (full version) projects
Media Composer First projects also cannot be opened in Media Composer

I don't see any console window, and not option to open it. Avid First can be opened from the console, but running EnableBinXMLDump true in that folder doesn't work.

tin2tin avatar Feb 22 '20 06:02 tin2tin

Thanks for looking, I never knew about avid first. I haven't done a new pip release yet, you don't have to wait. You can clone the git repo and ,python setup.py install it.

git clone https://github.com/markreidvfx/pyavb
cd pyavb
python setup.py install

Or you can could try something like this if you want to use pip. https://adamj.eu/tech/2019/03/11/pip-install-from-a-git-repository/

markreidvfx avatar Feb 22 '20 06:02 markreidvfx

Cool, now I see aaf files produced, however when trying to import Sequences in Davinci Resolve(Import Timeline). I get this error: image

Lightworks fails on import of the aaf files too, but without a meaningful error-message.

tin2tin avatar Feb 22 '20 07:02 tin2tin

The Resolve error doesn't help much either! The avb2aaf.py script is more of a proof of concept , I've only really tested the AAFs it generates in Media Composer. I took a quick look at the AAF generated from the sequence avb and there is nothing obvious wrong with the AAF that I can see. Most likely the AAF is missing some small piece of metadata that avid always sets and Resolve assumes is always present.

markreidvfx avatar Feb 23 '20 05:02 markreidvfx

I tried to import the aaf in Avid First, but it says it's an unsupported format - but that might simply mean that is a limitation(Avid First doesn't import Avid "Pro" files).

I opened the generated aaf file - wow, what a complicated format. Amazing what you're doing here.

It would have been great to convert the Avid First files into something readable by ex. Davinci Resolve, but maybe OTIO can read the aaf, I haven't tested that yet.

tin2tin avatar Feb 23 '20 10:02 tin2tin

OTIO should be able to read th AAF file, it uses pyaaf2 to read AAFs.

markreidvfx avatar Feb 23 '20 21:02 markreidvfx

I've identified the avb2aaf.py incompatibility issue with Resolve, it should be fixed in 16ba0ef22e2140ab8bc7d8ce3ebfd28976483e56

markreidvfx avatar Feb 27 '20 03:02 markreidvfx

I've tried the latest version, and now Resolve recognize the aaf files, but can't locate the media files.

They're located here on my computer: image

Pointing Resolve to that folder doesn't help either, but opening the files in the Resolve Media Pool makes them import correctly.

Resolve is missing the file names: image

For this import I used "imported" files in Avid, so maybe the file path is to be found a different place in the avb than when the file is linked? Eyeframe.zip

tin2tin avatar Mar 06 '20 08:03 tin2tin

I've updated to the latest Avid First and it seems like the BINF problem is back: Avid_test.zip (I've tried with both Linked and Imported files)

b'BINF'
b'464e49427d000000020e040000009da74e5ed93e18000000b7820100000000010000000300416e79010000000300416e79010000000300416e79010000000300416e79010000000300416e79010000000300416e7900000e010b00050001002700800032027d020100004d004d004d010000b300b300b30600030000000002010200000003'
Traceback (most recent call last):
  File "avb2aaf.py", line 805, in <module>
    avb2aaf_main(sys.argv[1])
  File "avb2aaf.py", line 792, in avb2aaf_main
    with avb.open(path) as avb_file:
  File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\avb\file.py", line 156, in __init__
    self.content = self.read_object(self.root_index)
  File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\avb\file.py", line 274, in read_object
    raise NotImplementedError(chunk.class_id)
NotImplementedError: b'BINF'```

tin2tin avatar May 07 '20 20:05 tin2tin

can you verify you are using the latest github version of pyav? BINF has been Implemented and the files work for me.

markreidvfx avatar May 10 '20 02:05 markreidvfx

I searched my harddisk and removed all pyaaf avb2aaf manually. Seems like pip uninstall didn't do the job properly.

Now running it without any notifications and an aaf file is generated. So I guess it just wasn't updated correctly.

However, importing it in Resolve(Timeline - Import - AAF) I get this error: image

The avid project is using "imported" footage and not "linked".

Don't have much time right now, so will do more tests later.

tin2tin avatar May 10 '20 06:05 tin2tin

Now a sequence with "Imported" files is working, as long as you manually add the source clips to the Resolve Media Pool yourself. Or does it find the files automatically for you?

tin2tin avatar May 10 '20 22:05 tin2tin

sorry for the delay, but did you end up resolving this? (and sorry for the resolve pun :p)

markreidvfx avatar Jun 13 '22 20:06 markreidvfx

I haven't checked the free Avid First since, but I can try with the latest update of it, if you want this working?

tin2tin avatar Jun 13 '22 21:06 tin2tin

I'm just doing some house keeping. If you don't have the time I can close the issue

markreidvfx avatar Jun 15 '22 02:06 markreidvfx