콘텐츠로 이동
Search

Avplayer

lastmod 2026-11-10created 2024-09-073 edits

avplayer는 PyAV 를 기반으로 만든 Python 미디어 플레이어다. FFmpeg 바인딩인 PyAV 로 비디오 파일이나 RTSP 스트림을 디코딩하고, 디코딩된 프레임을 큐에 담아 화면에 출력한다. 실시간 스트리밍에서는 지연을 줄이기 위해 오래된 프레임을 버리는 동작을 하며, 이 문서에는 그와 관련된 이슈 답변을 정리한다.

PyAV Media Player

이슈 목록 정리

When using tk, "The image queue is full. Drop the current frame" occurs on every frame

한글 답변:

의도된 동작 입니다.

rtsp 와 같은 실시간 스트리밍 환경에서 몇몇 프레임을 버리더라도 최신의 프레임을 제공하는 것이 유리하기 때문입니다. (이 경우 버퍼의 크기를 2~3 정도로 조정합니다.)

로컬 비디오 파일을 사용할 경우 TK 에서 프레임을 소비하는 속도 보다 제공하는 속도가 빠르기 때문에 버퍼 오버플로우를 막기위해 버퍼 크기에 제한을 걸었습니다.

버퍼의 크기 제한을 풀기 위해 `--win-queue-size 0` 옵션을 사용할 수도 있지만 메모리 사용량이 급격하게 올라갈 수 있으니 주의해 주세요.

tk 의 캔버스 드로우 속도를 높히고 싶었지만 아직 마땅한 방법을 찾지 못했습니다. 좋은 아이디어를 얻었다면 제공해 주시면 감사하겠습니다.

ChatGPT 4o 번역:

This is intended behavior.

In real-time streaming environments like RTSP, it is advantageous to provide the most recent frames, even if some frames are dropped. (In this case, adjust the buffer size to around 2~3.)

When using a local video file, the speed at which frames are provided is faster than the speed at which TK consumes them, so a limit has been set on the buffer size to prevent buffer overflow.

To remove the buffer size limit, you can use the --win-queue-size 0 option, but please be cautious as this may cause a sharp increase in memory usage.

I wanted to increase the drawing speed of the TK canvas, but I have yet to find a suitable method. If you have any good ideas, I would appreciate it if you could share them.

See also

Favorite site

author Zer0, MCPBot sitemap