mhdzumair / mediaflow-proxy

A high-performance proxy server for streaming media, supporting HTTP(S), HLS, and MPEG-DASH with real-time DRM decryption.
MIT License
51 stars 10 forks source link

ERROR - Video close after a while #26

Open sete22stey opened 4 days ago

sete22stey commented 4 days ago

Hello, after a few seconds of live tv, the video turns off and exits. I tested with version 1.7.5 and did not encounter this issue, but the video remains quite frozen.

The error I get is as follows:

ERROR - Error downloading https://zet2.hawwkc47.ru.com/ddh1/premium32/2024/11/15/14/14/46-06000.woff: All connection attempts failed 2024-11-15 14:15:24,207 - mediaflow_proxy.handlers - ERROR - Internal server error while handling request: All connection attempts failed httpx.ConnectError: All connection attempts failed

mhdzumair commented 4 days ago

From the log, what I saw is, it failed to get the DNS entry on the key URL. Do you face this error constantly?

sete22stey commented 3 days ago

I have updated to version 1.9 and it seems to work a little better, errors no longer occur but there are many channels that the image remains frozen, something that does not happen with version 1.7.5.

What I see in the logs all the time is the following:

2024-11-16 15:09:07,595 - mediaflow_proxy.mpd_processor - INFO - Added 1800 segments to HLS playlist
192.168.0.32:41762 - "GET /proxy/mpd/playlist.m3u8....=True HTTP/1.1" 200
2024-11-16 15:09:10,148 - mediaflow_proxy.mpd_processor - INFO - Added 1800 segments to HLS playlist
192.168.0.32:41764 - "GET /proxy/mpd/playlist.m3u8..... HTTP/1.1" 200
....

But what I would expect to see is one more log like the following every second or so

2024-11-16 15:14:47,808 - httpx - INFO - HTTP Request: GET https....
2024-11-16 15:14:47,821 - mediaflow_proxy.mpd_processor - INFO - Decryption of audio/mp4 segment took 0.0100 second
192.168.0.32:41962 - "GET /proxy/mpd/segment.mp4...

What could be happening? Could it be that my ISP is blocking my access? I have a local VPN server and I have tried with it activated and deactivated and it happens the same.

I apologize for the way I am explaining myself, my knowledge is very basic.

sete22stey commented 3 days ago

Update:

Update:

After 5 secs the image freezes and the logs I see every 3 secs are as follows, with the image frozen, not with the “loading” icon.

2024-11-16 17:29:01,651 - mediaflow_proxy.mpd_processor - INFO - Added 1800 segments to HLS playlist
172.17.0.1:37270 - "GET /proxy/mpd/playlist.m3u8?key

After about 5 mins I get the following error:

2024-11-16 17:29:23,926 - root - ERROR - An error occurred while processing the request.
Traceback (most recent call last):
  File "/mediaflow_proxy/.venv/lib/python3.12/site-packages/anyio/streams/memory.py", line 111, in receive
    return self.receive_nowait()
           ^^^^^^^^^^^^^^^^^^^^^
  File "/mediaflow_proxy/.venv/lib/python3.12/site-packages/anyio/streams/memory.py", line 106, in receive_nowait
    raise WouldBlock
anyio.WouldBlock
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/mediaflow_proxy/.venv/lib/python3.12/site-packages/anyio/streams/memory.py", line 124, in receive
    return receiver.item
           ^^^^^^^^^^^^^
AttributeError: 'MemoryObjectItemReceiver' object has no attribute 'item'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/mediaflow_proxy/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 157, in call_next
    message = await recv_stream.receive()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mediaflow_proxy/.venv/lib/python3.12/site-packages/anyio/streams/memory.py", line 126, in receive
    raise EndOfStream
anyio.EndOfStream
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/mediaflow_proxy/mediaflow_proxy/utils/crypto_utils.py", line 80, in dispatch
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mediaflow_proxy/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 163, in call_next
    raise app_exc

After this error, the video starts to play and logs like this are displayed:

2024-11-16 17:29:32,343 - httpx - INFO - HTTP Request: GET 

After 5 minutes of playback, the image freezes again and the server stops printing logs, it is as if the server died.

mhdzumair commented 3 days ago

the error log you posted doesn't contain the actual error. It was a bit down after the exception message you posted. Could you provide that info?

sete22stey commented 2 days ago

Attached is the complete error error_log.txt

mhdzumair commented 2 days ago

okay it was failed due to the caching cleanup. Fixed the issue, pull the latest version.

sete22stey commented 2 days ago

Thank you very much, it seems to be working properly.