{"record":{"id":"490fe42ab2ee12a8","repo":"affaan-m/ECC","slug":"base-track-count-exceeds-target-video-tracks","errorCode":null,"errorMessage":"base_track_count exceeds target video tracks","messagePattern":"base_track_count exceeds target video tracks","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"skills/taste-application/scripts/tasteforge/resolve.py","lineNumber":264,"sourceCode":"    media pool. Existing overlay tracks must be empty; base tracks are preserved.\n    source_end_mode is required: use the endpoint convention verified on this\n    Resolve host. No automatic retry occurs if that convention is incorrect.\n    \"\"\"\n    if source_end_mode not in (\"inclusive\", \"exclusive\"):\n        raise ValueError(\"source_end_mode must be inclusive or exclusive\")\n    if not isinstance(source_timeline, str) or not source_timeline:\n        raise ValueError(\"source_timeline must be explicit\")\n    name = timeline.GetName()\n    if not name or name == source_timeline:\n        raise ValueError(\"target must be a distinct versioned timeline\")\n    plan = allocate_placements(\n        placements, fps=fps, base_track_count=base_track_count, probe=probe\n    )\n    if _fps(timeline.GetSetting(\"timelineFrameRate\")) != _fps(fps):\n        raise ValueError(\"target timeline fps mismatch\")\n    count = timeline.GetTrackCount(\"video\")\n    if count < base_track_count:\n        raise ValueError(\"base_track_count exceeds target video tracks\")\n    for track in range(base_track_count + 1, count + 1):\n        if _items(timeline, \"video\", track):\n            raise ValueError(\"target overlay tracks must be empty\")\n    before = _base_snapshot(timeline, base_track_count)\n    for _ in range(count, max(event[\"track\"] for event in plan)):\n        old_count = timeline.GetTrackCount(\"video\")\n        if (\n            not timeline.AddTrack(\"video\")\n            or timeline.GetTrackCount(\"video\") != old_count + 1\n        ):\n            raise RuntimeError(\"could not create overlay track\")\n    appended = []\n    for event in plan:\n        imported = media_pool.ImportMedia([event[\"asset\"]])\n        if not imported or len(imported) != 1:\n            raise RuntimeError(f\"could not import {event['asset']}\")\n        items = media_pool.AppendToTimeline(\n            [","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/taste-application/scripts/tasteforge/resolve.py#L246-L282","documentation":"After the fps check, apply_placements verifies the target timeline already has at least base_track_count video tracks. base_track_count is the number of tracks reserved for the base edit; if the target timeline has fewer video tracks than that, the function cannot preserve the base layer and raises before mutating. The caller is expected to supply a target built with the same track layout as the source.","triggerScenarios":"Calling apply_placements(timeline, ..., base_track_count=4) on a freshly created Resolve timeline that has only 1 video track, or on a timeline whose video track count was reduced by the user.","commonSituations":"Creating the versioned target timeline via Resolve's default 'new timeline' (1 video track) while the source timeline has several base tracks; pointing apply at a blank timeline to 'start fresh'.","solutions":["Duplicate the source timeline as the target so it inherits the full video track count, then clear overlay tracks.","Add video tracks to the target until GetTrackCount('video') >= base_track_count before calling apply_placements.","Lower base_track_count to the actual number of base tracks present on the target."],"exampleFix":"// before\napply_placements(new_blank_tl, pool, placements, base_track_count=3, ...)\n// after\ntarget = src_tl.CreateDuplicateTimeline(\"v2\")\napply_placements(target, pool, placements, base_track_count=3, ...)","handlingStrategy":"validation","validationCode":"count = timeline.GetTrackCount(\"video\")\nif count < base_track_count:\n    raise ValueError(f\"target has {count} video tracks, need {base_track_count}\")","typeGuard":"def has_enough_video_tracks(timeline, base_track_count):\n    try:\n        return timeline.GetTrackCount(\"video\") >= base_track_count\n    except (AttributeError, TypeError):\n        return False","tryCatchPattern":"try:\n    apply_placements(tl, pool, placements, base_track_count=n, ...)\nexcept ValueError as e:\n    if \"exceeds target video tracks\" in str(e):\n        while tl.GetTrackCount(\"video\") < n:\n            tl.AddTrack(\"video\")\n        apply_placements(tl, pool, placements, base_track_count=n, ...)\n    else:\n        raise","preventionTips":["Build target timelines by duplicating the source, preserving track layout.","Log GetTrackCount('video') of the target right before applying.","Treat base_track_count as metadata captured from the source, not a guess."],"tags":["resolve","tracks","validation","timeline"],"backgroundTag":"value-out-of-range","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}