agfline / LibAAF

Library for Advanced Authoring Format (AAF) file reading.
GNU General Public License v2.0
25 stars 5 forks source link

Ardour Support - LibAAF v1.0 #28

Open agfline opened 6 months ago

agfline commented 6 months ago

Continuation of thread #5

johne53 commented 5 months ago

Thanks Adrien but please keep any Ardour changes to the minimum required. I'm inclined to be cautious at the moment because Ardour still hasn't delivered something that "just works" :-(

agfline commented 5 months ago

please keep any Ardour changes to the minimum required

Of course, but there is a minimum required. If you prefer I can do the changes on a fork of Ardour so you can test it before we push to mainstream ?

Ardour still hasn't delivered something that "just works"

I disagree. Unless there are bugs I don't know about, current version does actually work. What Schmitty2005 experienced was not a bug, but a missing feature. We knew that there was no reuse of extracted essences yet, with any AAF file. At some point, low disk space will be a problem with any AAF file. What Schmitty2005 demonstrated, is that libaaf is working with the latest version of Cubase, which had never been tested.

EDIT:

I'm inclined to be cautious at the moment

Since for me this is not a bug fix but an improvement, we can also keep those changes for the next version of libaaf, as you wish !

johne53 commented 5 months ago

Well let me put it this way... only one Ardour user has tried an import so far and his one and only test wouldn't work!

This morning I took a look to see if I could edit Ardour's current code manually and input your new changes - but unfortunately, Ardour's files can have different layouts, or they're in different places, or they're totally different sizes from yours with things having got moved into alternative files and lots of other annoyances. All this does is to highlight my previous view that LibAAF needs to be a 3rd party library along with the others like glib / pango etc. In situations like this, that'd make it much simpler to cherry-pick any vital changes without every update constantly needing to involve a major re-test (or get released untested...)

It's nobody's fault in particular but at the moment, our AAF implementation just seems like a badly managed mess and I'm afraid I don't have an answer. Yes, you can move things to a new Ardour fork but if it results in you bringing in hundreds of unnecessary/unrelated changes I just haven't time for a major re-test at the moment. Maybe Robin can offer some insight?

agfline commented 5 months ago

I think we don't understand each other...

I made a specific branch to move on with libaaf development, while keeping the master branch dedicated to Ardour and bug fix. So master branch is currently "sane" and free of any "annoying" change.

I implemented the essence reuse stuff on the second development branch, just for testing and seeing if I could make it work. I did. So now, I'm asking if you want me to report this feature to the master branch of libaaf, which involve only the code in this commit : 1dcaaae2b3b76315c397a372eb14ad9ea32f9af9, no more, no less (I'm not going to merge the two branches). But once I do that, I need to do a few changes in ardour_ui_aaf.cc because if the goal is to use an already imported Ardour source, I just can't make it happen on the libaaf side.

Well let me put it this way... only one Ardour user has tried an import so far and his one and only test wouldn't work!

It worked once he found he had less than 2GB left of disk space. If he had imported any of my working test file which is over than 1GB, it would also have failed. I'm no saying essence reuse is not important, it is, but it is not a bug strictly speaking.

johne53 commented 5 months ago

I'm asking if you want me to report this feature to the master branch of libaaf, which involve only the code in this commit : 1dcaaae, no more, no less (I'm not going to merge the two branches)

If that's possible, that'll be great Adrien! What I looked at this morning was merging your change into Ardour's code but it didn't look like that'd be possible without bringing in lots of other changes too.

So yes please - do give that a try.

agfline commented 5 months ago

OK, doing it tonight :+1:

johne53 commented 5 months ago

Hi Adrien - whenever you can find some spare time, is there a way you could test your code using Schmitty2005's test AAF?

https://drive.google.com/file/d/18T9mVUE13rUzfyBxyC4q2429vGxXYN5e/view?usp=sharing

It's quite possible I've done something wrong but I tested this morning with your latest changes and I'm not seeing any improvement ???

It's just a small AAF file but I'm seeing 38 imported WAV files here and that's the same number as before your changes.

P.S. The AAF file itself contains 14 x EssenceData objects.

agfline commented 5 months ago

Working well on my side. What repository have you used for testing ? Since my pull request has not been accepted yet, you should use the following reuse_essence branch of my forked repos : https://github.com/agfline/ardour/tree/reuse_essence

johne53 commented 5 months ago

Initially I updated the master branch from your LibAAf repo here:-

https://github.com/agfline/LibAAF/commits/master

I noticed that in commit #b04c547027 from yesterday, you'd changed 5 x files, namely:- AAFIEssenceFile.c / AAFIEssenceFile.h / AAFIface.c / AAFIface.h / AAFIParser.c

So as a temporary measure I copied those 5 files to their relevant locations in Ardour's aaf branch (i.e. overwriting Ardour's own versions) and rebuilt Ardour. I guess that doesn't work for some reason although I'm baffled as to why not...

0Edit...] Ah, I just realised why... you mentioned that ardour_ui_aaf.cc would need to change too - but of course that hasn't happened here yet !

agfline commented 5 months ago

If you don't update ardour_ui_aaf.cc it surely wont work... How could libaaf handle ardour source files ? Please note that lot of changes in that file are due to clang_format, don't know why there are so many.

johne53 commented 5 months ago

Yes, I realised the same thing just as you were posting. I'll need to wait for the latest ardour_ui_aaf.cc

prokoudine commented 4 months ago

@x42 suggested I post this here. i'm slightly confused by terminology in libAAF as seen in the Ardour integration. In particular by "essence". E.g. "AAF: Could not create new region for clip '%1': Missing audio essence". That sounds not very descriptive. Do you think this could improved? Or is it some standard AAF spec terminology that people should know?

johne53 commented 4 months ago

Yes, AAF has a few slightly weird bits of terminology. What we would call a "Session", AAF calls a "Composition". And what we would call a "Sound file", AAF calls an "Essence file". I think it's because AAF supports video transfers as well as audio.

It might be worth asking whoever supplied your AAF file if it's "embedded" (i.e. it contains sound files as well as a Composition). Or is it "non-embedded" (where it contains a Composition only - and the sound files are external to the AAF file...)

For editors who aren't familiar with AAF, they often prefer to generate non-embedded AAF files because they're a lot smaller. But it's then common for them to forget to include the various audio files! If you ask the editor to supply it "embedded" that should guarantee it'll contain all the relevant audio - but of course it'll be a much bigger AAF file. Hope that helps!

agfline commented 4 months ago

E.g. "AAF: Could not create new region for clip '%1': Missing audio essence". That sounds not very descriptive.

Note that this specific line should never print, as an essence should always have one or more essence files. In libaaf, the essence describes a media material that can be composed of multiple essence files, e.g. one per channel. As John pointed out, that terminology is based on AAF / MXF specifications.

That being said, we can try to make logging more explicit where possible in Ardour, for example "essence file" could be turned into "audio essence file" or "audio file".

agfline commented 4 months ago

@johne53, here is the change for naming Ardour session based on AAF file name : https://github.com/Ardour/ardour/pull/895

johne53 commented 3 months ago

"AAF: Could not create new region for clip '%1': Missing audio essence".

Hi @prokoudine - did you manage to make it work eventually?

prokoudine commented 3 months ago

@johne53 Oh, I didn't have this issue per se. I translate Ardour into my native language, that's why I asked the question.