Skip to content

Conversation

@alighaemia
Copy link

This pull request updates the API and internal data structures to provide detailed codec information for each track in a path, replacing the previous approach of representing tracks as simple strings. The changes affect the OpenAPI schema, Go structs, serialization, and related tests, enabling clients to access richer metadata for video and audio tracks.

API and Schema Changes

  • Added a new PathTrack schema to api/openapi.yaml that includes detailed fields for codec type, video dimensions, frame rate, profiles, levels, and audio properties. The tracks property in the Path schema is now an array of PathTrack objects instead of strings. [1] [2]

Go Struct and Serialization Updates

  • Introduced the APIPathTrack struct in internal/defs/api.go with fields for codec, video, and audio details. Updated the APIPath struct and all relevant usages to use []APIPathTrack instead of []string for tracks.
  • Refactored serialization logic in internal/core/path.go and related test mocks to populate detailed track info using the new MediasToTracks and FormatsToTracks functions. [1] [2]

Track Information Extraction

  • Added functions to extract and format profile, level, and other codec-specific metadata from media formats in internal/defs/source.go. These functions parse codec parameters and build APIPathTrack objects with appropriate fields. [1] [2]

Test Updates

  • Updated all affected tests to use the new APIPathTrack struct for tracks, ensuring correct serialization and deserialization of detailed track info. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

Unit Tests for Track Extraction

  • Added a comprehensive unit test suite for the new track extraction logic in internal/defs/source_test.go, covering all supported codecs and validating correct population of metadata fields.

Copilot AI and others added 3 commits December 31, 2025 18:07
- Add APIPathTrack struct with codec details (profile, level, resolution, etc.)
- Update APIPath.Tracks from []string to []APIPathTrack
- Add FormatToTrack and MediasToTracks helper functions
- Update OpenAPI spec with PathTrack schema
- Add unit tests for FormatToTrack function
- Update existing tests to use new track structure

Co-authored-by: alighaemia <[email protected]>
@aler9
Copy link
Member

aler9 commented Jan 5, 2026

Hello, this is almost correct, although evidently entirely AI-generated. The main issue is that it breaks API compatibility, since the "tracks" key of Path was a string and is now an object. Please move the new object to tracks2 and restore the existing tracks. Thanks.

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

Successfully merging this pull request may close these issues.

2 participants