markreidvfx / pyavb

Read and write Avid Bin FIles (AVB) files
https://pyavb.readthedocs.io
MIT License
58 stars 4 forks source link

building a group clip from master clips and syncing #7

Closed russellaugust closed 2 years ago

russellaugust commented 4 years ago

first off, this library is amazing. it opens up so many avenues to help workflow at my post house.

Digging through the code, I get the impression it may be possible to create group clips, subclips or sync audio from master clips. Since you built it, I figure you could answer that question before I dig too far down the rabbit hole.

russellaugust commented 4 years ago

From what I'm seeing, group clips are referred to as SELECTORS?

markreidvfx commented 4 years ago

yes, groupclips I believe are called selectors, I sometimes used the AAF names for objects. It is definitely possible to do what you are describing, the module can write any AVB object that I've been able to document. It might take a lot of trial and error to get it working. The best way is to match the structure of a file that does what you want and start from there.

russellaugust commented 4 years ago

@markreidvfx do you know what the left_bob and right_bob are? Trying to trace it back and understand what it is but haven't found much. I was thinking it was referencing the BOBPosition and had to do with the composition's in/out boundaries but it always seems to return None.

To give you some context, I'm just trying to rip apart the Selector to see what's in it. The Selector seems to be made up of more tracks (which is to be expected, I figured it should somewhat resemble a sequence) but those tracks don't have any of the properties I was expecting that are listed here. The only available property is component.

I'm basically just looking to see how a Selector forms and aligns the sync for each picture and sound track in a .avb I have with a single group clip in it. Hitting a bit of a wall.

    with avb.open(test_file_01) as f:
        for item in f.content.items:
            for track in item.mob.tracks:
                # Selectors
                if isinstance(track.component, avb.trackgroups.Selector):
                    print("-------- Selector! --------")
                    selector = track.component
                    print(item.mob.name)
                    for selector_track in selector.tracks:
                        print("selector_track content: {}".format(selector_track))
markreidvfx commented 4 years ago

Maybe this helps, that's how I've been able to translate it to a AAF selector https://github.com/markreidvfx/pyavb/blob/master/examples/avb2aaf.py#L335

I'm not entirely sure what the Bob data ref is, I think is some legacy OMF thing. I thought it might be in the original OMF spec, but I've been unable to find it anywhere. My guess was Bob means, bytes of binary or bag of bits. Left and right could be some sort of linked list structure, but I don't know.

The XML representation of a bin file calls it __OMFI:CPNT:LeftBob

communque commented 1 year ago

@russellaugust Any luck with this?

russellaugust commented 1 year ago

No luck yet unfortunately. It's pretty complicated as far as I can tell.

communque commented 1 year ago

@russellaugust Thanks for the followup. Complicated no doubt. So far I've been able to change the sync of items contained in a group clip. That part seems easy. No luck adding clips though, not yet at least.

russellaugust commented 1 year ago

I'll be digging deeper into this as well over the coming months, so I'll share any of my findings. Let me know what you find.