{"action":"created","issue":{"url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/733","repository_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO","labels_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/733/labels{/name}","comments_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/733/comments","events_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/733/events","html_url":"https://github.com/miguelgrinberg/Flask-SocketIO/issues/733","id":339607556,"node_id":"MDU6SXNzdWUzMzk2MDc1NTY=","number":733,"title":"Streaming Video and Audio","user":{"login":"pudg","id":10677478,"node_id":"MDQ6VXNlcjEwNjc3NDc4","avatar_url":"https://avatars2.githubusercontent.com/u/10677478?v=4","gravatar_id":"","url":"https://api.github.com/users/pudg","html_url":"https://github.com/pudg","followers_url":"https://api.github.com/users/pudg/followers","following_url":"https://api.github.com/users/pudg/following{/other_user}","gists_url":"https://api.github.com/users/pudg/gists{/gist_id}","starred_url":"https://api.github.com/users/pudg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pudg/subscriptions","organizations_url":"https://api.github.com/users/pudg/orgs","repos_url":"https://api.github.com/users/pudg/repos","events_url":"https://api.github.com/users/pudg/events{/privacy}","received_events_url":"https://api.github.com/users/pudg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-07-09T21:06:51Z","updated_at":"2018-07-09T21:32:56Z","closed_at":null,"author_association":"NONE","body":"I'm trying to stream a webcam feed captured using OpenCV, and audio captured using PyAudio that's used as input to a waveform visualizer. I've followed miguels guide on [streaming video](https://blog.miguelgrinberg.com/post/video-streaming-with-flask) but the issue is when i'm trying to stream the audio at the same time. Off the bat when I start my server, app.py the webcam feed works fine, and after i refresh, the audio thread gets started and I can see that it's running since refreshing prints \"emitting audio bytes: 0\", \"emitting audio bytes: 57\", and so on.\r\n`        socket_io.emit('audio_bytes', {'data': frames})\r\n`\r\n My issue seems to be that my client (javascript) can't seem to communicate with my audio_thread. I've noticed that if I stop my server (app.py) and don't close my browswer tab, then restart the server the browser actually renders the audio, waveforms visuals appear, and console logs also, but the webcam feed is frozen. Refreshing my browser starts the webcam feed, but I loose the audio visualizer and console logs."},"comment":{"url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/comments/403627418","html_url":"https://github.com/miguelgrinberg/Flask-SocketIO/issues/733#issuecomment-403627418","issue_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/733","id":403627418,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMzYyNzQxOA==","user":{"login":"miguelgrinberg","id":2715854,"node_id":"MDQ6VXNlcjI3MTU4NTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/2715854?v=4","gravatar_id":"","url":"https://api.github.com/users/miguelgrinberg","html_url":"https://github.com/miguelgrinberg","followers_url":"https://api.github.com/users/miguelgrinberg/followers","following_url":"https://api.github.com/users/miguelgrinberg/following{/other_user}","gists_url":"https://api.github.com/users/miguelgrinberg/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelgrinberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelgrinberg/subscriptions","organizations_url":"https://api.github.com/users/miguelgrinberg/orgs","repos_url":"https://api.github.com/users/miguelgrinberg/repos","events_url":"https://api.github.com/users/miguelgrinberg/events{/privacy}","received_events_url":"https://api.github.com/users/miguelgrinberg/received_events","type":"User","site_admin":false},"created_at":"2018-07-09T21:32:56Z","updated_at":"2018-07-09T21:32:56Z","author_association":"OWNER","body":"Okay, if you are using `socketio.run()` then your web server should be correctly configured. Did you install eventlet or gevent in your virtualenv? I'm not sure if these frameworks are compatible with pyaudio and opencv. If you have any of these packages installed, try removing them to see if things work better. The performance will drop because without an async framework there is no websocket support, but at least we'll confirm that the problem is there."}}
{"actor":{"display_login":"miguelgrinberg"}}