Git Product home page Git Product logo

fastapi-frame-stream's Introduction

(def tiago
  {:name "Tiago Prata"
   :pronoums "he/him"
   :work-place "ABB"
   :education ["M.Sc in Automation and Control" 
               "B.Sc. in Automation and Control Engineering"]
   :age 32
   :city "Sรฃo Paulo, ๐Ÿ‡ง๐Ÿ‡ท"
   :interests ["machine learning" "python" 
               "control theory" "free software" 
               "web" "math" "latex" 
               "embedded software" "hacks"]
   :lang [๐Ÿ‡ง๐Ÿ‡ท, ๐Ÿ‡ฌ๐Ÿ‡ง, ๐Ÿ‡ช๐Ÿ‡ธ]})

Find me on:

fastapi-frame-stream's People

Contributors

tiagoprata avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

krzysztofole

fastapi-frame-stream's Issues

Client streamer javascript

Hi Tiago,
this is a very smart solution, thank you so much for your effort. Actually I try to stream a camera by python script,
but is very very slow, in your C# app it works on realtime. Is it possible to find a way to embedded the streamer into
javascript html file, so it will be easier to use it?

Many thanks

#################################################
import cv2
import base64
import json
import requests
import imutils

class BytesEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, bytes):
return obj.decode('utf-8')
return json.JSONEncoder.default(self, obj)

url = "http://localhost:8000/send_frame_from_string/stream002"

cam = cv2.VideoCapture(0)

while (True):
ret, frame = cam.read()
frame = imutils.resize(frame, width=320) # get frame from webcam
res, frame = cv2.imencode('.jpg', frame) # from image to binary buffer
base64str = base64.b64encode(frame) # convert to base64 format
payload = json.dumps({"img_base64str": base64str}, cls=BytesEncoder)
response = requests.post(url,data = payload)

multiple streams in the same page problem

Hi @TiagoPrata i'm creating several streams from different pcs to monitor them in a single page but it's only letting me open 6 streams and no more. I don't know if this is a thread pool limit or a browser limitation, as some say, becose it doesn't work in any of mine (chrome, edge and firefox). I'm working on a Windows machine by the way. Can you help me, please?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.