Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yanndr/capture
Grpc service to capture an image from a video
https://github.com/yanndr/capture
capture go-kit grpc prometheus service video
Last synced: about 1 month ago
JSON representation
Grpc service to capture an image from a video
- Host: GitHub
- URL: https://github.com/yanndr/capture
- Owner: yanndr
- License: mit
- Created: 2017-08-10T20:40:26.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-06T19:28:24.000Z (over 1 year ago)
- Last Synced: 2023-08-12T09:12:59.882Z (over 1 year ago)
- Topics: capture, go-kit, grpc, prometheus, service, video
- Language: Go
- Size: 9.3 MB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# capture
GRPC service to capture an image from a video## About
I needed to extract an image from a video for a personal website project. I wanted to keep the code in an external library; so I created a service that exposed the function by GRPC.
Why GRPC? Because I wanted to learn about it, [Go-kit](https://github.com/go-kit/kit) and [Promotheus](https://github.com/prometheus/client_golang)## Installation
This service depends on [screengen](github.com/opennota/screengen), which requires having [ffmpeg](https://ffmpeg.org/) installed if you want to run it locally.```
go get github.com/yanndr/capturedocker build -t capture ./cmd/CaptureService/
```
## Usage
Run the Service with Docker
Without a certificate:
```
docker run --rm -it -p 50051:50051 -p 8080:8081 capture
```
With a certificate
```
docker run --rm -it -p 50051:50051 -p 8080:8081 -v /PATHTOCERT/cert -e CAPTURE_CERTPATH='/cert/cert.pem' -e CAPTURE_KEYPATH='cert/key.pem' capture
```Then the Service will expose 2 functions by GRPC:
rpc ExtractImage (stream VideoCaptureRequest) returns (VideoCaptureReply) {}
rpc AddOverlay (stream OverlayImageRequest) returns (VideoCaptureReply) {}metrics will be available at http://localhost:8080/metrics
There is a client example in cmd/CaptureClient:
```
go run cmd/CaptureClient/main.go pathtoVideofile