Skip to content

KeyError: 'frameStart' when loading flat media (.mp4) in DaVinci Resolve #96

Description

@sidmehraajm

Is there an existing issue for this?

  • I have searched the existing issues and added correct labels.

Description

When attempting to load an .mp4 representation into DaVinci Resolve using the AYON Loader, the process crashes with a KeyError: 'frameStart'.

This occurs because flat video containers (like .mp4) do not always have explicit frameStart or frameEnd attributes saved to their specific Version document in the database (even if they inherit it from a parent Shot/Folder). The load_media.py script strictly assumes these keys exist in version["attrib"] and fails if they do not.

Steps to Reproduce
Publish an .mp4 file (or any media lacking explicit frame attributes on the Version level) to a project.

Open DaVinci Resolve and launch the AYON Loader.

Attempt to load the .mp4 representation (e.g., Product: "imageAI", Representation: "mp4", Version: 1).

See the KeyError crash in the console.

Error Traceback

Steps To Reproduce:

When attempting to load an .mp4 representation into DaVinci Resolve using the AYON Loader, the process crashes with a KeyError: 'frameStart'.

This occurs because flat video containers (like .mp4) do not always have explicit frameStart or frameEnd attributes saved to their specific Version document in the database (even if they inherit it from a parent Shot/Folder). The load_media.py script strictly assumes these keys exist in version["attrib"] and fails if they do not.

Steps to Reproduce
Publish an .mp4 file (or any media lacking explicit frame attributes on the Version level) to a project.

Open DaVinci Resolve and launch the AYON Loader.

Attempt to load the .mp4 representation (e.g., Product: "imageAI", Representation: "mp4", Version: 1).

See the KeyError crash in the console.
During load error happened on Product: "imageAI" Representation: "mp4" Version: 1

The issue is located in client/ayon_resolve/plugins/load/load_media.py inside the _get_container_data function (around line 389). The script should safely fetch these attributes using .get() rather than a strict dictionary lookup.

version.attrib

    for key in [
        "frameStart", "frameEnd",
        "handleStart", "handleEnd",
        "source", "fps", "colorSpace"
    ]:
        data[key] = version["attrib"][key]

version.attrib

    for key in [
        "frameStart", "frameEnd",
        "handleStart", "handleEnd",
        "source", "fps", "colorSpace"
    ]:
        data[key] = version["attrib"].get(key)

Environment:
Host Application: DaVinci Resolve

AYON Core Addon: 1.9.0

AYON Resolve Addon: 0.6.0

OS: Windows 10/11

Additional context:

No response

Relevant log output:

Error message: 'frameStart'

Traceback (most recent call last):
  File "C:\Users\...\AppData\Local\Ynput\AYON\addons\core_1.9.0\ayon_core\tools\loader\models\actions.py", line 1005, in _load_representations_by_loader
    load_with_repre_context(
  File "C:\Users\...\AppData\Local\Ynput\AYON\addons\core_1.9.0\ayon_core\pipeline\load\utils.py", line 327, in load_with_repre_context
    return loader.load(repre_context, name, namespace, options)
  File "C:\Users\...\AppData\Local\Ynput\AYON\addons\core_1.9.0\ayon_core\pipeline\load\plugins.py", line 430, in wrapped_method
    result = original_method(self, *args, **kwargs)
  File "C:\Users\...\AppData\Local\Ynput\AYON\addons\resolve_0.6.0\ayon_resolve\plugins\load\load_media.py", line 224, in load
    item = self._import_media_to_bin(context, media_pool, representation)
  File "C:\Users\...\AppData\Local\Ynput\AYON\addons\resolve_0.6.0\ayon_resolve\plugins\load\load_media.py", line 284, in _import_media_to_bin
    data = self._get_container_data(context)
  File "C:\Users\...\AppData\Local\Ynput\AYON\addons\resolve_0.6.0\ayon_resolve\plugins\load\load_media.py", line 389, in _get_container_data
    data[key] = version["attrib"][key]
KeyError: 'frameStart'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions