Skip to content

macOS screen capture example not work #1810

Closed Answered by WyattBlue
zak-45 asked this question in 1. Help
Discussion options

You must be logged in to vote

This should your blocking error:

try:
    while True:
        try:
            for frame in input_.decode(video=0):
                packet = output_stream.encode(frame)
                output.mux(packet)
        except av.BlockingIOError:
            pass
except KeyboardInterrupt:
    print("Recording stopped by user")

packet = output_stream.encode(None)
output.mux(packet)

input_.close()
output.close()

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by WyattBlue
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants