Closed nkarpov closed 6 months ago
bro,I met the same problem,have you solved it? I guess it is because of the “bitstring" version,I will try other version later
Hi, all
I merged this pull request https://github.com/Eittipat/pyrtmp/pull/13 let see if it help
@Eittipat I have the same error with the pip version and your github code, this is my stacktrace:
DEBUG:asyncio:Using selector: KqueueSelector
INFO:pyrtmp.rtmp:Serving on ('0.0.0.0', 1935)
DEBUG:pyrtmp.rtmp:Client connected 192.168.0.37:42904
ERROR:pyrtmp.rtmp:Needed a length of at least 12224 bits, but only 10632 bits were available.
Traceback (most recent call last):
File "/Users/pedro/Desktop/piTests/venv/lib/python3.12/site-packages/pyrtmp/rtmp.py", line 79, in client_callback
await self.on_handshake(session)
File "/Users/pedro/Desktop/piTests/venv/lib/python3.12/site-packages/pyrtmp/rtmp.py", line 120, in on_handshake
await session.handshake()
File "/Users/pedro/Desktop/piTests/venv/lib/python3.12/site-packages/pyrtmp/session_manager.py", line 56, in handshake
await C2.from_stream(self.fifo_reader)
File "/Users/pedro/Desktop/piTests/venv/lib/python3.12/site-packages/pyrtmp/messages/handshake.py", line 57, in from_stream
rand = await stream.read("bytes:1528")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/pedro/Desktop/piTests/venv/lib/python3.12/site-packages/pyrtmp/__init__.py", line 42, in read
value = self.buffer.read(fmt)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/pedro/Desktop/piTests/venv/lib/python3.12/site-packages/bitstring/bitstream.py", line 349, in read
val = dtype.read_fn(self, self._pos)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/pedro/Desktop/piTests/venv/lib/python3.12/site-packages/bitstring/dtypes.py", line 300, in read_fn
raise bitstring.ReadError(f"Needed a length of at least {length} bits, but only {len(bs) - start} bits were available.")
bitstring.exceptions.ReadError: Needed a length of at least 12224 bits, but only 10632 bits were available.
DEBUG:pyrtmp.rtmp:Clean up 192.168.0.37:42904
Regards.
I will check it this weekend, can you give me a your test file @PedroSumur
I will check it this weekend, can you give me a your test file @PedroSumur
@Eittipat the test file is from your examples, don't worry about that.
Btw, I have the same error with my laptop with fedora 40 and my macbook pro m1 with mac os Sonoma, both laptops with python 3.12.
Regards and thanks for your work.
@Eittipat first of all, thank you for this lib.
I installed pyrtmp with the following command to enforce using the latest version, but I still run into the problem mentioned above.
pip install --no-cache-dir --upgrade pyrtmp@git+https://github.com/Eittipat/pyrtmp.git@ee8bf199d7dec0a599cda1224e50fe40f44f46b9
I'm using the example mentioned in the readme, do you have any suggestions?
Hi, bitstring
needs to be version >=4.1<=4.2. I fixed in https://github.com/Eittipat/pyrtmp/pull/20 and released new version v0.3.1
Thank for all feedback
Perfect, I'll give it a shot. Thanks!
Was trying to get this working on a local env (mac m1, 14.4.1) and running into a handshake issue with the readme examples. Pulled and ran the tests directly in master and getting the same...
Is this an environment thing? Here's the ffmpeg version/config in case it's relevant
Appreciate any advice - thanks!