# Assertion fctx-\>async\_lock failed at libavcodec/pthread\_frame.c:173

**URL:** <https://forum.opencv.org/t/assertion-fctx-async-lock-failed-at-libavcodec-pthread-frame-c-173/18733>\
**Category:** Python\
**Created:** [September 12, 2024, 9:13am UTC](https://forum.opencv.org/t/assertion-fctx-async-lock-failed-at-libavcodec-pthread-frame-c-173/18733 "2024-09-12T09:13:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Baraa\_Lalagui](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/baraa_lalagui/32/11094_2.png) [@Baraa\_Lalagui](https://forum.opencv.org/u/Baraa_Lalagui)\
**Post date:** [September 12, 2024, 9:13am UTC](https://forum.opencv.org/t/assertion-fctx-async-lock-failed-at-libavcodec-pthread-frame-c-173/18733/1 "2024-09-12T09:13:25Z")

</div>

Hello,  
I have a question, if you could please provide me with answers if you have encountered this problem before:  
I have been getting this error upon reading a video capture:  
`Assertion fctx->async_lock failed at libavcodec/pthread_frame.c:173`

I have been getting this error too:  
cv2.error: Unknown C++ exception from OpenCV code

`ret, frame = VideoCapture(RTSP_LINK, cv.FFMPEG).read()`

knowing that this is how I’m using it:

```auto

def read_cam(channel):
    while True:
        ret, frame = vcaps[channel].read()
        if ret:
            with fr_bf_modify_lock:
                frames_buffer[channel].append(frame)

```
