AcademySoftwareFoundation / AcademySoftwareFoundation/OpenTimelineIO

IndexError: No SlotID: 0

Open
#1,334 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
2k
Forks
351
Avg merge
1d 12h
Merged PRs (30d)
1

Description

## Bug Report
I am trying to use OTIO to get AAF data with python, I can open some AAF file & work with those with no problem but for some others I get an error.
```
File "/Users/diego.dominguez01/Documents/pyenv/marvel_proj/lib/python3.9/site-packages/aaf2/mobs.py", line 82, in slot_at
raise IndexError("No SlotID: %s" % str(slot_id))
IndexError: No SlotID: 0
```

## To Reproduce

1. Operating System: MacOS 14.2.
2. Python version: 3.9.5
3. Example snippet that demonstrates the issue - if it's a build issue
```
import opentimelineio as otio

timeline = otio.adapters.read_from_file('my_file.aaf')
for clip in timeline.each_clip():
print(clip.name)
```
4. OpenTimelineIO release version or commit hash: OpenTimelineIO 0.14.1 as well as with the branch git+https://github.com/andrewmoore-nz/OpenTimelineIO.git@0d9fb920668556dce3f62662766b8550a8c56243
5. Compiler information:
```
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: x86_64-apple-darwin21.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
```

## Expected Behavior
Interact with the clips, tracks, etc, just as the same with other files, this happens with a few files, nothing particular special about those files.

## Screenshots
![Screen Shot 2022-06-20 at 16 29 52](https://user-images.githubusercontent.com/107076713/174680022-7b350d61-2e19-43f7-a250-442935b8e97b.png)

## Logs
```
Traceback (most recent call last):
File "/Users/diego.dominguez01/Documents/aaf-parser-collab/parsing_aaf.py", line 30, in
my_otio = MyOTIO(file_name=file_name, path=path, file_index=index)
File "/Users/diego.dominguez01/Documents/aaf-parser-collab/components/otio_component.py", line 19, in __init__
self.my_otio = self.reading_file()
File "/Users/diego.dominguez01/Documents/aaf-parser-collab/components/otio_component.py", line 35, in reading_file
return otio.adapters.read_from_file(file_path)
File "/Users/diego.dominguez01/Documents/pyenv/marvel_proj/lib/python3.9/site-packages/opentimelineio/adapters/__init__.py", line 143, in read_from_file
return adapter.read_from_file(
File "/Users/diego.dominguez01/Documents/pyenv/marvel_proj/lib/python3.9/site-packages/opentimelineio/adapters/adapter.py", line 145, in read_from_file
result = self._execute_function(
File "/Users/diego.dominguez01/Documents/pyenv/marvel_proj/lib/python3.9/site-packages/opentimelineio/plugins/python_plugin.py", line 174, in _execute_function
return (getattr(self.module(), func_name)(**kwargs))
File "/Users/diego.dominguez01/Documents/pyenv/marvel_proj/lib/python3.9/site-packages/opentimelineio_contrib/adapters/advanced_authoring_format.py", line 1568, in read_from_file
result = _transcribe(mobs_to_transcribe, parents=list(), edit_rate=None)
File "/Users/diego.dominguez01/Documents/pyenv/marvel_proj/lib/python3.9/site-packages/opentimelineio_contrib/adapters/advanced_authoring_format.py", line 827, in _transcribe
result.append(_transcribe(child, parents + [item], edit_rate, indent + 2))
File "/Users/diego.dominguez01/Documents/pyenv/marvel_proj/lib/python3.9/site-packages/opentimelineio_contrib/adapters/advanced_authoring_format.py", line 447, in _transcribe
track = _transcribe(slot, parents + [item], edit_rate, indent + 2)
File "/Users/diego.dominguez01/Documents/pyenv/marvel_proj/lib/python3.9/site-packages/opentimelineio_contrib/adapters/advanced_authoring_format.py", line 673, in _transcribe
child = _transcribe(item.segment, parents + [item], edit_rate, indent + 2)
File "/Users/diego.dominguez01/Documents/pyenv/marvel_proj/lib/python3.9/site-packages/opentimelineio_contrib/adapters/advanced_authoring_format.py", line 659, in _transcribe
child = _transcribe(component, parents + [item], edit_rate, indent + 2)
File "/Users/diego.dominguez01/Documents/pyenv/marvel_proj/lib/python3.9/site-packages/opentimelineio_contrib/adapters/advanced_authoring_format.py", line 665, in _transcribe
result = _transcribe_operation_group(item, parents, metadata,
File "/Users/diego.dominguez01/Documents/pyenv/marvel_proj/lib/python3.9/site-packages/opentimelineio_contrib/adapters/advanced_authoring_format.py", line 1154, in _transcribe_operation_group
child = _transcribe(segment, parents + [item], edit_rate, indent)
File "/Users/diego.dominguez01/Documents/pyenv/marvel_proj/lib/python3.9/site-packages/opentimelineio_contrib/adapters/advanced_authoring_format.py", line 659, in _transcribe
child = _transcribe(component, parents + [item], edit_rate, indent + 2)
File "/Users/diego.dominguez01/Documents/pyenv/marvel_proj/lib/python3.9/site-packages/opentimelineio_contrib/adapters/advanced_authoring_format.py", line 542, in _transcribe
mastermob_child = _transcribe(mastermob, list(), edit_rate, indent)
File "/Users/diego.dominguez01/Documents/pyenv/marvel_proj/lib/python3.9/site-packages/opentimelineio_contrib/adapters/advanced_authoring_format.py", line 447, in _transcribe
track = _transcribe(slot, parents + [item], edit_rate, indent + 2)
File "/Users/diego.dominguez01/Documents/pyenv/marvel_proj/lib/python3.9/site-packages/opentimelineio_contrib/adapters/advanced_authoring_format.py", line 673, in _transcribe
child = _transcribe(item.segment, parents + [item], edit_rate, indent + 2)
File "/Users/diego.dominguez01/Documents/pyenv/marvel_proj/lib/python3.9/site-packages/opentimelineio_contrib/adapters/advanced_authoring_format.py", line 659, in _transcribe
child = _transcribe(component, parents + [item], edit_rate, indent + 2)
File "/Users/diego.dominguez01/Documents/pyenv/marvel_proj/lib/python3.9/site-packages/opentimelineio_contrib/adapters/advanced_authoring_format.py", line 476, in _transcribe
mobs = _find_timecode_mobs(item)
File "/Users/diego.dominguez01/Documents/pyenv/marvel_proj/lib/python3.9/site-packages/opentimelineio_contrib/adapters/advanced_authoring_format.py", line 304, in _find_timecode_mobs
for c in item.walk():
File "/Users/diego.dominguez01/Documents/pyenv/marvel_proj/lib/python3.9/site-packages/aaf2/components.py", line 201, in walk
for item in clip.walk():
File "/Users/diego.dominguez01/Documents/pyenv/marvel_proj/lib/python3.9/site-packages/aaf2/components.py", line 183, in walk
if not self.slot:
File "/Users/diego.dominguez01/Documents/pyenv/marvel_proj/lib/python3.9/site-packages/aaf2/components.py", line 157, in slot
return mob.slot_at(slot_id)
File "/Users/diego.dominguez01/Documents/pyenv/marvel_proj/lib/python3.9/site-packages/aaf2/mobs.py", line 82, in slot_at
raise IndexError("No SlotID: %s" % str(slot_id))
IndexError: No SlotID: 0
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with the reported AAF input and read opentimelineio_contrib/adapters/advanced_authoring_format.py around read_from_file, _transcribe, and _find_timecode_mobs. Trace the IndexError through aaf2/components.py and aaf2/mobs.py, then verify that the affected AAF files can be read and their clips iterated without the missing SlotID error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.