Code Monkey home page Code Monkey logo

python-opencv_ffmpeg_streaming's Introduction

face-recognition-system

Simple face recognition system

Installation

pip install cv2-ffmpeg_streaming 

or

git clone https://github.com/BlackCatDevel0per/python-opencv_ffmpeg_streaming
cd python-opencv_ffmpeg_streaming
python setup.py install

Install requirements

sudo apt-get install libboost-numpy-dev

Examples in tests directory

import cv2
import time
from rtmp_streaming import StreamerConfig, Streamer

cap = cv2.VideoCapture(0)
# run "ffplay -listen 1 -i 'rtmp://127.0.0.1:8000/stream' to display
ret, frame = cap.read()

sc = StreamerConfig()
sc.source_width = frame.shape[1]
sc.source_height = frame.shape[0]
sc.stream_width = 640
sc.stream_height = 480
sc.stream_fps = 20
sc.stream_bitrate = 1000000
sc.stream_profile = 'main' #'high444' # 'main'
sc.stream_server = 'rtmp://127.0.0.1:8000/stream'


streamer = Streamer()
streamer.init(sc)
#streamer.enable_av_debug_log()


prev = time.time()

show_cap = True

while(True):

    ret, frame = cap.read()
    now = time.time()
    duration = now - prev
    streamer.stream_frame_with_duration(frame, int(duration*100)) #0
    prev = now
    #if show_cap:
    #    cv2.imshow('frame', frame)
    #    if cv2.waitKey(1) & 0xFF == ord('q'):
    #        break


cap.release()
#if show_cap:
#    cv2.destroyAllWindows()

python-opencv_ffmpeg_streaming's People

Contributors

andreanobile avatar blackcatdevel0per avatar jaydonchion avatar

Stargazers

Rahmatullo Qosimov avatar

Watchers

 avatar

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.