PyAV icon indicating copy to clipboard operation
PyAV copied to clipboard

"Error number -10014 occurred" when reading UDP stream after 16.0.0 on Windows

Open EnzoPB opened this issue 2 months ago • 0 comments

I am streaming a video using ffmpeg: ffmpeg -re -i file.mp4 -f mpegts udp://localhost:2000, which I'm trying to read using pyav:

import av

c = av.open('udp://localhost:2000')

for packet in c.demux():
    print(packet)

It works fine with pyav<15.0.0, but after 16.0.0 it gives this error while trying to open the stream:

Traceback (most recent call last):
  File "testudp.py", line 3, in <module>
    c = av.open('udp://localhost:2000')
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "av/container/core.pyx", line 482, in av.container.core.open
    return InputContainer(_cinit_sentinel, file, format, options,
  File "av/container/core.pyx", line 298, in av.container.core.Container.__cinit__
    self.err_check(res)
  File "av/container/core.pyx", line 318, in av.container.core.Container.err_check
    return err_check(value, filename=self.name)
  File "av/error.pyx", line 424, in av.error.err_check
    raise cls(code, message, filename, log)
av.error.OSError: [Errno 10014] Error number -10014 occurred: 'udp://localhost:2000'

This problem doesn't occur on linux.

Windows version: 10.0.26100 Build 26100 Python version: Python 3.11.9 (tags/v3.11.9:de54cf5, Apr 2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)] on win32

EnzoPB avatar Dec 01 '25 11:12 EnzoPB