Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set StartTime of filler, or sequence? #38

Closed
MartinSRimsbo opened this issue Mar 8, 2019 · 4 comments
Closed

Set StartTime of filler, or sequence? #38

MartinSRimsbo opened this issue Mar 8, 2019 · 4 comments

Comments

@MartinSRimsbo
Copy link

Hi! Thanks for an amazing module.

The answer to this question might be obvious, and I hope it is ok to ask questions here, but I can't find a way to set my sequence start time, or the start time of a filler for that matter. I thought that the EventSlotOrigin would be able to set the start time, but I cant get it to work in Pro Tools. If I open the AAF in Media Composer and export it straight away it ends up on 01:00:00:00 as I want it to, but when comparing all props between the two aafs I can't find the difference.

Very much appreciate any help.
Rather simplified my code looks like this:

import aaf2

with aaf2.open("newaaf.aaf", 'w') as f:
    ems = f.create.EventMobSlot()
    ems['EditRate'].value = 25
    ems['EventSlotOrigin'].value = 9000 #as a test value, does not work
    ems['SlotID'].value = 1000
    ems['PhysicalTrackNumber'].value = 1

    sequence = f.create.Sequence("DescriptiveMetadata")
    marker = f.create.DescriptiveMarker()
    marker['DescribedSlots'].value = set([1])
    marker['Position'].value = 100
    marker['CommentMarkerUser'].value = "A new marker that ends up in PT Comment-field"
    sequence.components.append(marker)

    ems.segment = sequence
    mob = f.create.CompositionMob()
    p_slot = mob.create_sound_slot()
    filler  = f.create.Filler("sound", 0)
    p_slot.segment.components.append(filler)
    p_slot['PhysicalTrackNumber'].value = 1
    mob.slots.append(ems)
    f.content.mobs.append(mob)

Best regards
Martin Sandström

@markreidvfx
Copy link
Owner

Add another slot with a single TimeCode component to the compositionMob. Timecode.start should be the set to the start time you want.

@MartinSRimsbo
Copy link
Author

Thanks a lot!
Following your instructions I added:

tc_slot = mob.create_empty_sequence_slot(25, media_kind='timecode')
tc = f.create.Timecode(25, False)
tc.start = 90000
tc_slot.segment.components.append(tc)

And it Worked like a charm.
Best

@markreidvfx
Copy link
Owner

👍 no problem.

@zozzancs
Copy link

zozzancs commented Feb 28, 2023

I just tried this above, I'm glad I found this discussion, however for some reason it doesn't seem to work for me.
Duration is set to 1 sec, but the 10 hour starttime doesn't seem to work, it defaults to 1 hour.

Any suggestions, please?
This is driving me crazy, I even asked chatgpt, no luck :)

comp_mob= f.create.CompositionMob()
comp_mob.usage = "Usage_TopLevel"
comp_mob.name = "whatever"

tc = f.create.Timecode(timecode_fps, True)
tc.start = 900000  # 10 hours
tc.length = timecode_fps  # 1 sec

timeline_slotV = comp_mob.create_timeline_slot(edit_rate)
timeline_slotV["PhysicalTrackNumber"].value = 1
sequenceV = f.create.Sequence(media_kind="picture")
timeline_slotV.segment = sequenceV
comp_fillV = f.create.Filler("picture", 0)
sequenceV.components.append(comp_fillV)
sequenceV.components.append(tc)

f.content.mobs.append(comp_mob)

Also when using only this code

tc_slot = mob.create_empty_sequence_slot(25, media_kind='timecode')
tc = f.create.Timecode(25, False)
tc.start = 90000
tc.length = 25
tc_slot.segment.components.append(tc)

I get a nice timeline starting at 10 hours with the duration of 1 sec, but when checking it in the bin, it says 0 dur and 0 start tc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants