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.

Stream crashing after a while

See original GitHub issue

Bug Report

  • This is a bug report and I have read the contribution guidelines.

Description

After some time playing (sometimes a minute, sometimes 30), the remote stream is crashing, although it works fine on VLC desktop for example.

Expected / Actual behavior

I would like for the stream to continue on, or even try to reconnect automatically if it crashes. Right now it is crashing after some minutes, using VLC or OMXPlayer on Raspberry Pi 4.

Reproduction steps / Explicit stream URLs to test

I’m using a Raspberry Pi (same behavior on a Raspberry Pi A (yes the first Raspberry Pi generation) and a Raspberry Pi 4). Tried over WiFi and Ethernet so the link doesn’t seem to be the problem.

  1. Run streamlink https://sarralbe.hdr-tv.com/live/sarralbe/sarralbe.stream/manifest_w1345660299.mpd best --player vlc --fifo (--fifo doesn’t seem to change a thing)
  2. Wait until it crashes.

Log output

[cli][debug] OS:         Linux-4.19.97-v7l+-armv7l-with-debian-10.3
[cli][debug] Python:     3.7.3
[cli][debug] Streamlink: 1.0.0
[cli][debug] Requests(2.21.0), Socks(1.6.7), Websocket(0.53.0)
[cli][info] Found matching plugin dash for URL https://sarralbe.hdr-tv.com/live/sarralbe/sarralbe.stream/manifest_w1345660299.mpd
[plugin.dash][debug] Parsing MPD URL: https://sarralbe.hdr-tv.com/live/sarralbe/sarralbe.stream/manifest_w1345660299.mpd
[utils.l10n][debug] Language code: en_GB
[stream.dash][debug] Available languages for DASH audio streams: NONE (using: n/a)
[cli][info] Available streams: 1600k (worst, best)
[cli][info] Opening stream: 1600k (dash)
[stream.dash][debug] Opening DASH reader for: p0va0br1585108 (video/mp4)
[cli][debug] Pre-buffering 8192 bytes
[stream.dash_manifest][debug] Generating segment timeline for dynamic playlist (id=0))
[stream.dash][debug] Reloading manifest (p0va0br1585108:video/mp4)
[stream.dash][debug] Download of segment: https://sarralbe.hdr-tv.com/live/sarralbe/sarralbe.stream/chunk_ctvideo_cfm4s_ridp0va0br1585108_cinit_w1345660299_mpd.m4s complete
[cli][info] Creating pipe streamlinkpipe-1334
[cli][info] Starting player: vlc
[cli.output][debug] Opening subprocess: vlc --input-title-format https://sarralbe.hdr-tv.com/live/sarralbe/sarralbe.stream/manifest_w1345660299.mpd /tmp/streamlinkpipe-1334
[cli][debug] Writing stream to output
[stream.dash_manifest][debug] Generating segment timeline for dynamic playlist (id=0))
[stream.dash][debug] Reloading manifest (p0va0br1585108:video/mp4)
[stream.dash][debug] Download of segment: https://sarralbe.hdr-tv.com/live/sarralbe/sarralbe.stream/chunk_ctvideo_cfm4s_ridp0va0br1585108_cs142671614574060_w1345660299_mpd.m4s complete
[stream.dash_manifest][debug] Generating segment timeline for dynamic playlist (id=0))
[stream.dash][debug] Reloading manifest (p0va0br1585108:video/mp4)
[stream.dash][debug] Download of segment: https://sarralbe.hdr-tv.com/live/sarralbe/sarralbe.stream/chunk_ctvideo_cfm4s_ridp0va0br1585108_cs142671615473880_w1345660299_mpd.m4s complete
[stream.dash_manifest][debug] Generating segment timeline for dynamic playlist (id=0))
[stream.dash][debug] Reloading manifest (p0va0br1585108:video/mp4)
[stream.dash][debug] Download of segment: https://sarralbe.hdr-tv.com/live/sarralbe/sarralbe.stream/chunk_ctvideo_cfm4s_ridp0va0br1585108_cs142671616373700_w1345660299_mpd.m4s complete
[stream.dash][debug] Download of segment: https://sarralbe.hdr-tv.com/live/sarralbe/sarralbe.stream/chunk_ctvideo_cfm4s_ridp0va0br1585108_cs142671617273520_w1345660299_mpd.m4s complete
[stream.dash][debug] Download of segment: https://sarralbe.hdr-tv.com/live/sarralbe/sarralbe.stream/chunk_ctvideo_cfm4s_ridp0va0br1585108_cs142671618173340_w1345660299_mpd.m4s complete
error: Error when reading from stream: Read timeout, exiting
[stream.segmented][debug] Closing worker thread
[stream.segmented][debug] Closing writer thread
[cli][info] Stream ended
[cli][info] Closing currently open stream...
Exception in thread Thread-DASHStreamWorker:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 384, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 380, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/lib/python3.7/http/client.py", line 1336, in getresponse
    response.begin()
  File "/usr/lib/python3.7/http/client.py", line 306, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.7/http/client.py", line 275, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 367, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/lib/python3/dist-packages/six.py", line 692, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 384, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 380, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/lib/python3.7/http/client.py", line 1336, in getresponse
    response.begin()
  File "/usr/lib/python3.7/http/client.py", line 306, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.7/http/client.py", line 275, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/streamlink/plugin/api/http_session.py", line 164, in request
    *args, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 498, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3/dist-packages/streamlink/stream/segmented.py", line 59, in run
    for segment in self.iter_segments():
  File "/usr/lib/python3/dist-packages/streamlink/stream/dash.py", line 97, in iter_segments
    if not self.reload():
  File "/usr/lib/python3/dist-packages/streamlink/stream/dash.py", line 111, in reload
    res = self.session.http.get(self.mpd.url, exception=StreamError)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 546, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python3/dist-packages/streamlink/plugin/api/http_session.py", line 175, in request
    raise err
streamlink.exceptions.StreamError: Unable to open URL: https://sarralbe.hdr-tv.com/live/sarralbe/sarralbe.stream/manifest_w1345660299.mpd (('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')))

I get more log when not redirecting stdout to a file, here is the end:

streamlink.exceptions.StreamError: Unable to open URL: https://sarralbe.hdr-tv.com/live/sarralbe/sarralbe.stream/manifest_w1345660299.mpd (('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')))

[stream.dash][debug] Download of segment: https://sarralbe.hdr-tv.com/live/sarralbe/sarralbe.stream/chunk_ctvideo_cfm4s_ridp0va0br1585108_cs142672281341130_w1345660299_mpd.m4s complete
[stream.dash][debug] Download of segment: https://sarralbe.hdr-tv.com/live/sarralbe/sarralbe.stream/chunk_ctvideo_cfm4s_ridp0va0br1585108_cs142672282240950_w1345660299_mpd.m4s complete
error: Error when reading from stream: Read timeout, exiting
[stream.segmented][debug] Closing worker thread
[stream.segmented][debug] Closing writer thread
[cli][info] Stream ended
[cli][info] Closing currently open stream...

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:24

github_iconTop GitHub Comments

1reaction
GilDevcommented, Apr 2, 2020

No that’s what I wrote, streamlink command is on the first post but it works quite badly.

0reactions
GilDevcommented, Jul 21, 2020

Thanks, my script worked for 6 days straight and then started glitching, it may be because the WiFi link is a bit weak sometimes because of the WiFi USB dongle, but I would have guessed it would restart if it failed or crash… Why wouldn’t cvlc be your choice then? Streamlink is just a wrapper when used with cvlc, and it won’t work for me… Also yeah I want real-time video as birds are sometimes quite active and it’s fun to see them eat for example.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[SOLVED] OBS Crashing on Windows 11/10 - 2022
If OBS constantly crashes on your Windows 10/11 or causes the games to crash while streaming, here are 5 simple fixes to try....
Read more >
OBS Keeps Crashing: How to Stop it [Steps Vetted by Gamers]
1. Reset the graphics card app · 2. Change OBS compatibility · 3. Uninstall and reinstall OBS · 4. Disable the Windows 10...
Read more >
OBS Crashes after a few hours of streaming
Lately, I've been streaming and after a few hours, stream crashes. ... This can result in audio drift over time or sound distortion....
Read more >
Computer crashes while streaming : r/Twitch - Reddit
Computer crashes while streaming. No idea why it happens but it only happens when I stream. Sometimes I'll be able to stream for...
Read more >
Fix OBS Studio 28 Crashing on Windows 10/11 - YouTube
For more information, follow this guide:https://www.techy.how/tutorials/obs-studio- crashing -fix-windowsA short tutorial on how to prevent ...
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