Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing VIDEO for proxied MPD -> m3u8, Incorrectly Labeled Tracks as Audio in HLS Manifest Conversion? #29

Open
ChronoBrake1 opened this issue Nov 26, 2024 · 0 comments

Comments

@ChronoBrake1
Copy link

Dear MediaFlow Proxy Developer,

title: Missing VIDEO in Shaka Player and HLS Player

I have discovered a bug in the MediaFlow Proxy when converting MPD-DASH media files to HLS (m3u8) manifests. Specifically, all tracks are being incorrectly labeled as audio tracks in the resulting HLS manifest, even those that are video tracks.

Issue Details:

When performing a GET request to /proxy/mpd/manifest.m3u8 with the following parameters, the generated HLS manifest lists all streams with TYPE=AUDIO, and video tracks are incorrectly associated with the audio group.

Request:

GET /proxy/mpd/manifest.m3u8

Parameters:

  • d: in Attachments
  • key_id: in Attachments
  • key: in Attachments
  • api_password: your_password

Curl Command:

curl -X 'GET' \
  'PROXIEDURL' \
  -H 'accept: application/json'

Response:

#EXTM3U
#EXT-X-VERSION:6
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="1",DEFAULT=YES,AUTOSELECT=YES,LANGUAGE="pol",URI="PROXY/proxy/mpd/playlist.m3u8?...&profile_id=1"
#EXT-X-STREAM-INF:BANDWIDTH=7000000,RESOLUTION=1920x1080,CODECS="avc1.4d4029",FRAME-RATE=29.97,AUDIO="audio"
PROXY/proxy/mpd/playlist.m3u8?...&profile_id=0
#EXT-X-STREAM-INF:BANDWIDTH=3000000,RESOLUTION=1280x720,CODECS="avc1.4d4029",FRAME-RATE=29.97,AUDIO="audio"
PROXY/proxy/mpd/playlist.m3u8?...&profile_id=4
#EXT-X-STREAM-INF:BANDWIDTH=2500000,RESOLUTION=1280x720,CODECS="avc1.4d4029",FRAME-RATE=29.97,AUDIO="audio"
PROXY/proxy/mpd/playlist.m3u8?...&profile_id=8
#EXT-X-STREAM-INF:BANDWIDTH=1600000,RESOLUTION=1024x576,CODECS="avc1.4d4029",FRAME-RATE=29.97,AUDIO="audio"
PROXY/proxy/mpd/playlist.m3u8?...&profile_id=12
#EXT-X-STREAM-INF:BANDWIDTH=1100000,RESOLUTION=640x352,CODECS="avc1.4d4029",FRAME-RATE=29.97,AUDIO="audio"
PROXY/proxy/mpd/playlist.m3u8?...&profile_id=16
#EXT-X-STREAM-INF:BANDWIDTH=400000,RESOLUTION=512x288,CODECS="avc1.4d4029",FRAME-RATE=29.97,AUDIO="audio"
PROXY/proxy/mpd/playlist.m3u8?...&profile_id=20

As you can see, all the #EXT-X-STREAM-INF entries reference AUDIO="audio", even for video streams, and there's no distinction between audio and video tracks.

Expected Behavior:

The original MPD manifest correctly differentiates between video and audio AdaptationSets:

<MPD ...>
    <Period>
        <AdaptationSet id="0" group="1" contentType="video" mimeType="video/mp4" ...>
            <!-- Video Representations -->
            <Representation id="0" codecs="avc1.4d4029" bandwidth="7000000" width="1920" height="1080" />
            <!-- Additional video representations -->
        </AdaptationSet>
        <AdaptationSet id="1" group="2" contentType="audio" mimeType="audio/mp4" lang="pol" ...>
            <!-- Audio Representation -->
            <Representation id="1" codecs="mp4a.40.2" bandwidth="128000" audioSamplingRate="48000" />
        </AdaptationSet>
    </Period>
</MPD>

The HLS manifest should reflect this by properly assigning video and audio types. Video streams should not be labeled as audio, and the AUDIO attribute should only be associated with actual audio groups.

Impact:

This mislabeling causes media players to misinterpret the streams, leading to playback issues. Video tracks are treated as audio, which can result in errors or missing video during playback.

Steps to Reproduce:

  1. Use the provided MPD URL and parameters.
  2. Send a GET request to /proxy/mpd/manifest.m3u8.
  3. Inspect the returned HLS manifest and observe that all tracks are labeled with TYPE=AUDIO.

Environment:

  • MediaFlow Proxy Version: Latest (as of the date of this report)
  • Tested On: Multiple environments and media players (Missing VIDEO in Shaka Player and HLS Player)
  • MPD URL: As provided above

Possible Cause:

It appears that during the conversion from MPD to HLS, the logic that handles the mapping of AdaptationSets to HLS media groups might be incorrectly assigning the TYPE attribute. The converter may be defaulting all tracks to audio without checking the contentType or mimeType attributes of each AdaptationSet.

Suggested Solution:

  • Update the conversion logic to:

    • Check the contentType or mimeType of each AdaptationSet.
    • Assign TYPE=VIDEO for video AdaptationSets and TYPE=AUDIO for audio AdaptationSets in the HLS manifest.
    • Ensure that #EXT-X-STREAM-INF entries correctly reference their associated audio groups only when applicable.

Additional Information:

  • The issue is consistent with this specific MPD manifest but may affect others with similar structures.
  • Proper handling of multiple AdaptationSets is crucial for correct playback, especially in streams with multiple audio or subtitle tracks.

Attachments:

  • [Original MPD Manifest](attach the full MPD manifest if possible)
  • [Generated HLS Manifest](attach the generated HLS manifest)

Thank you for your attention to this matter. Please let me know if you need any additional information or assistance in reproducing the issue.

Best regards,
report.zip

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

No branches or pull requests

1 participant