MediaStreams Array not mirroring Media Files Tracks #2655

Closed
opened 2026-02-06 22:17:34 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @neilsb on GitHub (Feb 21, 2021).

When a subtitle track has an undefined language it appears at the end of the MediaStreams array when querying the details of an item, rather than at the actual track position in the media file. This results in the MediaStreams array not matching the structure of the Media File.

As an example, in this official sample mkv file has track 6 appears to be a subtitle track with no language:

image

But when querying the item details from Jellyfin the results are (Track 6 appears in Position 10)

image

Would either expect the order of the MediaStreams array to match the source file, to allow use of the Array Index to identify the track in the file, or for the MediaStrams[x].Index field to reference the file's track index.

Edit: This is happening on latest 10.7 docker images

Originally created by @neilsb on GitHub (Feb 21, 2021). When a subtitle track has an undefined language it appears at the end of the `MediaStreams` array when querying the details of an item, rather than at the actual track position in the media file. This results in the `MediaStreams` array not matching the structure of the Media File. As an example, in this [official sample mkv file](https://github.com/Matroska-Org/matroska-test-files/blob/master/test_files/test5.mkv) has track 6 appears to be a subtitle track with no language: ![image](https://user-images.githubusercontent.com/5013482/108631689-fb7fb600-7462-11eb-855e-846de4fcc37c.png) But when querying the item details from Jellyfin the results are (Track 6 appears in Position 10) ![image](https://user-images.githubusercontent.com/5013482/108631702-0f2b1c80-7463-11eb-88fb-efc7d5a2632a.png) Would either expect the order of the `MediaStreams` array to match the source file, to allow use of the Array Index to identify the track in the file, or for the `MediaStrams[x].Index` field to reference the file's track index. Edit: This is happening on latest 10.7 docker images
OVERLORD added the bugconfirmed labels 2026-02-06 22:17:34 +03:00
Author
Owner

@cvium commented on GitHub (Apr 11, 2021):

Cannot reproduce with the uploaded file

@cvium commented on GitHub (Apr 11, 2021): Cannot reproduce with the uploaded file
Author
Owner

@neilsb commented on GitHub (Apr 11, 2021):

So the file has moved since the issue was posted but the seems to be exactly the same, and I still get the same results on 7.10.1 and Unstable (latest docker)

Requests to /Users/{UserId}/Items/{ItemId} still returns the same as above, with the Spanish subtitles in position 7 (and property Index has value 7 also) and the latest VLC (3.0.12) is showing the Italian subtitle track as being track 8.

Having said all that, using ffmpeg it does show the same order the API

Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp (default)
    Stream #0:2(eng): Subtitle: subrip (default)
    Stream #0:3(hun): Subtitle: subrip
    Stream #0:4(ger): Subtitle: subrip
    Stream #0:5(fre): Subtitle: subrip
    Stream #0:6(spa): Subtitle: subrip
    Stream #0:7(ita): Subtitle: subrip
    Stream #0:8(eng): Audio: aac (LC), 22050 Hz, mono, fltp
    Metadata:
      title           : Commentary
    Stream #0:9(jpn): Subtitle: subrip
    Stream #0:10: Subtitle: subrip

So maybe the problem is VLC? In which case I guess we can close this issue.

@neilsb commented on GitHub (Apr 11, 2021): So the file [has moved](https://raw.githubusercontent.com/Matroska-Org/matroska-test-files/cf0792be144ac470c4b8052cfe19bb691993e3a2/test_files/test5.mkv) since the issue was posted but the seems to be exactly the same, and I still get the same results on 7.10.1 and Unstable (latest docker) Requests to `/Users/{UserId}/Items/{ItemId}` still returns the same as above, with the Spanish subtitles in position 7 (and property `Index` has value 7 also) and the latest VLC (3.0.12) is showing the Italian subtitle track as being track 8. Having said all that, using ffmpeg it does show the same order the API ``` Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp (default) Stream #0:2(eng): Subtitle: subrip (default) Stream #0:3(hun): Subtitle: subrip Stream #0:4(ger): Subtitle: subrip Stream #0:5(fre): Subtitle: subrip Stream #0:6(spa): Subtitle: subrip Stream #0:7(ita): Subtitle: subrip Stream #0:8(eng): Audio: aac (LC), 22050 Hz, mono, fltp Metadata: title : Commentary Stream #0:9(jpn): Subtitle: subrip Stream #0:10: Subtitle: subrip ``` So maybe the problem is VLC? In which case I guess we can close this issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#2655