question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

plugins.svtplay: Stream selection

See original GitHub issue

Checklist

Streamlink version

Latest stable release

Description

SVTPlay live streams usually have 2 different 720p streams. One of them is a h264 main profile ~2500kbit/s. The other one is a h264 high profile ~4000kbit/s.

If I start a stream with the “best” stream selector it picks the low bitrate main profile stream. If I want the higher bitrate high profile stream I have to manually select the “720p_alt” stream.

Debug log

streamlink.exe --loglevel debug https://www.svtplay.se/video/33017618/vinterstudion/vinterstudion-28-nov-10-45 best
[cli][debug] OS:         Windows 10
[cli][debug] Python:     3.9.8
[cli][debug] Streamlink: 3.0.2
[cli][debug] Requests(2.26.0), Socks(1.7.1), Websocket(1.2.1)
[cli][debug] Arguments:
[cli][debug]  url=https://www.svtplay.se/video/33017618/vinterstudion/vinterstudion-28-nov-10-45
[cli][debug]  stream=['best']
[cli][debug]  --loglevel=debug
[cli][debug]  --player="C:\Program Files\MPC-HC\mpc-hc64.exe"
[cli][debug]  --ffmpeg-ffmpeg=C:\Program Files (x86)\Streamlink\ffmpeg\ffmpeg.exe
[cli][info] Found matching plugin svtplay for URL https://www.svtplay.se/video/33017618/vinterstudion/vinterstudion-28-nov-10-45
[plugins.svtplay][debug] Path=/
[plugins.svtplay][debug] VOD ID=KqyyXXg
[utils.l10n][debug] Language code: sv_SE
[stream.dash][debug] Available languages for DASH audio streams: sv, sv-x-tal (using: sv)
[cli][info] Available streams: 234p (worst), 360p, 540p, 720p_alt, 720p (best)
[cli][info] Opening stream: 720p (dash)
[stream.dash][debug] Opening DASH reader for: 3 (video/mp4)
[stream.dash][debug] Opening DASH reader for: 5 (audio/mp4)
[stream.dash_manifest][debug] Generating segment numbers for dynamic playlist (id=0)
[stream.dash_manifest][debug] Generating segment numbers for dynamic playlist (id=1)
[utils.named_pipe][info] Creating pipe streamlinkpipe-8368-1-1664
[utils.named_pipe][info] Creating pipe streamlinkpipe-8368-2-9097
[stream.ffmpegmux][debug] ffmpeg command: C:\Program Files (x86)\Streamlink\ffmpeg\ffmpeg.exe -nostats -y -i \\.\pipe\streamlinkpipe-8368-1-1664 -i \\.\pipe\streamlinkpipe-8368-2-9097 -c:v copy -c:a copy -copyts -f matroska pipe:1
[stream.ffmpegmux][debug] Starting copy to pipe: \\.\pipe\streamlinkpipe-8368-1-1664
[stream.ffmpegmux][debug] Starting copy to pipe: \\.\pipe\streamlinkpipe-8368-2-9097
[cli][debug] Pre-buffering 8192 bytes
[stream.dash][debug] Download of segment: https://svt-event-19-c.akamaized.net/se/1400840-053W/14c98a5b-0ebc-4c18-8300-6b88f0b3cc01/dash-a0/a0-init.mp4 complete
[stream.dash][debug] Download of segment: https://svt-event-19-c.akamaized.net/se/1400840-053W/14c98a5b-0ebc-4c18-8300-6b88f0b3cc01/dash-v3/v3-init.mp4 complete
[stream.dash][debug] Waiting for segment: a0-3937.mp4 (2.9s)
[stream.dash][debug] Download of segment: https://svt-event-19-c.akamaized.net/se/1400840-053W/14c98a5b-0ebc-4c18-8300-6b88f0b3cc01/dash-a0/a0-3936.mp4 complete
[stream.dash][debug] Waiting for segment: v3-3937.mp4 (2.8s)
[stream.dash][debug] Download of segment: https://svt-event-19-c.akamaized.net/se/1400840-053W/14c98a5b-0ebc-4c18-8300-6b88f0b3cc01/dash-v3/v3-3936.mp4 complete
[cli][info] Starting player: "C:\Program Files\MPC-HC\mpc-hc64.exe"
[cli.output][debug] Opening subprocess: "C:\Program Files\MPC-HC\mpc-hc64.exe" -
[cli][debug] Writing stream to output
[stream.dash][debug] Waiting for segment: a0-3938.mp4 (3.1s)
[stream.dash][debug] Download of segment: https://svt-event-19-c.akamaized.net/se/1400840-053W/14c98a5b-0ebc-4c18-8300-6b88f0b3cc01/dash-a0/a0-3937.mp4 complete
[stream.dash][debug] Waiting for segment: v3-3938.mp4 (3.1s)
[stream.dash][debug] Download of segment: https://svt-event-19-c.akamaized.net/se/1400840-053W/14c98a5b-0ebc-4c18-8300-6b88f0b3cc01/dash-v3/v3-3937.mp4 complete
[stream.dash][debug] Waiting for segment: a0-3939.mp4 (3.1s)
[stream.dash][debug] Download of segment: https://svt-event-19-c.akamaized.net/se/1400840-053W/14c98a5b-0ebc-4c18-8300-6b88f0b3cc01/dash-a0/a0-3938.mp4 complete
[stream.dash][debug] Waiting for segment: v3-3939.mp4 (3.1s)
[stream.dash][debug] Download of segment: https://svt-event-19-c.akamaized.net/se/1400840-053W/14c98a5b-0ebc-4c18-8300-6b88f0b3cc01/dash-v3/v3-3938.mp4 complete
[stream.dash][debug] Waiting for segment: a0-3940.mp4 (3.1s)
[stream.dash][debug] Download of segment: https://svt-event-19-c.akamaized.net/se/1400840-053W/14c98a5b-0ebc-4c18-8300-6b88f0b3cc01/dash-a0/a0-3939.mp4 complete
[stream.dash][debug] Waiting for segment: v3-3940.mp4 (3.0s)
[stream.dash][debug] Download of segment: https://svt-event-19-c.akamaized.net/se/1400840-053W/14c98a5b-0ebc-4c18-8300-6b88f0b3cc01/dash-v3/v3-3939.mp4 complete
[stream.dash][debug] Waiting for segment: a0-3941.mp4 (3.1s)
[stream.dash][debug] Download of segment: https://svt-event-19-c.akamaized.net/se/1400840-053W/14c98a5b-0ebc-4c18-8300-6b88f0b3cc01/dash-a0/a0-3940.mp4 complete
[stream.dash][debug] Waiting for segment: v3-3941.mp4 (3.1s)
[stream.dash][debug] Download of segment: https://svt-event-19-c.akamaized.net/se/1400840-053W/14c98a5b-0ebc-4c18-8300-6b88f0b3cc01/dash-v3/v3-3940.mp4 complete
[cli][info] Player closed
[stream.ffmpegmux][debug] Closing ffmpeg thread
[stream.segmented][debug] Closing worker thread
[stream.segmented][debug] Closing writer thread
[stream.ffmpegmux][debug] Pipe copy complete: \\.\pipe\streamlinkpipe-8368-1-1664
[stream.dash][debug] Waiting for segment: a0-3942.mp4 (3.1s)
[stream.dash][debug] Download of segment: https://svt-event-19-c.akamaized.net/se/1400840-053W/14c98a5b-0ebc-4c18-8300-6b88f0b3cc01/dash-a0/a0-3941.mp4 complete
[stream.segmented][debug] Closing worker thread
[stream.segmented][debug] Closing writer thread
[stream.ffmpegmux][debug] Pipe copy complete: \\.\pipe\streamlinkpipe-8368-2-9097
[stream.ffmpegmux][debug] Closed all the substreams
[cli][info] Stream ended
[cli][info] Closing currently open stream...

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
zappepappecommented, Nov 29, 2021

After some more testing it seems to only be an issue with live content. On VODs 720p is the best stream and 720p_alt is the low bitrate one. If there is a 1080p stream that is naturally the best stream and no 720p_alt stream will exist. While on live channels and events 720p_alt is the best stream and 720p is the low bitrate one.

1reaction
bastimeyercommented, Nov 29, 2021

I’m not quite following what you mean here.

@mkbloke, instead of yield from DASHStream.parse_manifest(...).items(), the plugin could reorder + rename the streams manually. If it’s indeed an issue, which I can’t say as it’s geo-restricted and I don’t feel like setting up a proxy/vpn for this.

Or if one wants to improve DASHStream.parse_manifest they could add a name_key argument similar to HLSStream.parse_variant_playlist.

A quick test - from the beginning of that VoD while looking at the stats (key I in mpv) while playing, seems to show higher running bitrates for 720p than 720p_alt for me.

The codec information of the DASH manifest example from above suggests the same, but this doesn’t mean that it’s the case for every manifest returned by the site.

  1. 720p

    <Representation id="0" bandwidth="4316313" width="1280" height="720" codecs="avc1.640020" sar="1:1" mimeType="video/mp4">

    bandwidth = 4316313 avc1.640020 = High Level 3.2

  2. 720p_alt

    <Representation id="1" bandwidth="2814785" width="1280" height="720" codecs="avc1.4d4020" sar="1:1" mimeType="video/mp4">

    bandwidth = 2814785 avc1.4d4020 = Constrained Main Level 3.2

Read more comments on GitHub >

github_iconTop Results From Across the Web

Svtplay's Plugin is currently broken · Issue #3133 - GitHub
Go to Svtplay.se with a Swedish Ip, Vpn or Proxy. Pick some show and it's URL; Try to stream it with streamlink. Log...
Read more >
[RELEASE] SVT Play (Plugin) Video Addon - KODI Forum
Regarding the stream stop issue I experience the same problem in both SVT-Play and XOT, both with HD and SD material. However some...
Read more >
SVT Play - IWF1
With this addon you can stream content from SVT Play (svtplay.se). ... where you've downloaded the addon to and select it to Install....
Read more >
Add-on:SVT Play - Official Kodi Wiki
With this addon you can stream content from SVT Play (svtplay.se). ... Settings; Add-ons; Install from repository; Video Add-ons; SVT Play; Install.
Read more >
Topic: How to embed video from svtplay.se (New WikiLeaks ...
The topic 'How to embed video from svtplay.se (New WikiLeaks documentary)?' is closed to new replies. Learn to do anything on WordPress.com.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found