zestream / zestream-server Goto Github PK
View Code? Open in Web Editor NEWan open-sourced alternative to cloudinary [video streaming done โ , image/audio under dev ๐จ ]
License: GNU General Public License v3.0
an open-sourced alternative to cloudinary [video streaming done โ , image/audio under dev ๐จ ]
License: GNU General Public License v3.0
Is your feature request related to a problem? Please describe.
We need to have a feature to add watermark to the video while generating the multi-bitrate video. The image will be present in downloads/directory and the filePath will be given, checkout service/dash.go for more details.
Describe the solution you'd like
Image file is present in downloads/
folder, and the (x,y)
coordinates will be passed to function, and inject the image in all the bitrate videos at the given bitrate.
Write a function in utils
folder, which takes a folder path and cloud storage name (was, gcp, azure) and uploads the whole folder to the cloud storage
It should have the following:
Feel free to add any new points
We need to write a function which takes a timestamp (HH:MM:SS string) and generates a thumbnail from the video and stores in output/video_id folder (as for now)
We need an endpoint which takes the below object in body and publishes an event in Kafka (Kafka URI present in environment variable, if not present throw Err while starting service).
{
"video": {
"id": "string",
"src": "string",
"type": "mp4"
}
}
HTTP timeouts are necessary to expire inactive connections and failing to do so might make the application vulnerable to attacks like slowloris which work by sending data very slow, which in case of no timeout will keep the connection active eventually leading to a denial-of-service (DoS) attack.
There is 1 occurrence of this issue in the repository.
See all occurrences on DeepSource โ deepsource.io/gh/ZeStream/zestream-server/issue/GO-S2114/occurrences/
A possible solution could be
server := &http.Server{
Addr: port,
ReadTimeout: time.Duration(timeout) * time.Second,
WriteTimeout: time.Duration(timeout) * time.Second,
}
err := server.ListenAndServe()
Add Test cases for the function UploadToCloudStorage
and all possible functions in utils/upload.go
The cloud provider services needs to be mocked over here (Eg: AWS, GCP and Azure)
Describe the solution you'd like
Create a Hash function in Golang, which takes a file name and URL params, and returns MD5 hash of it.
Approach
Append the key and values of params to the file name, sort the string and generate MD5 hash and return.
Step 1: fileName-key1:value1;key2:value2;........keyN:valueN
Step 2: sort the above string
Step 3: Calculate MD5 of the string and return
Is your feature request related to a problem? Please describe.
Documentation
Describe the solution you'd like
As now we have function to upload the folder directly, there should be a doc when people can read and easily understand, how to setup GCP/Azure/AWS.
We need a function which takes an enum (Azure, GCP, AWS, Firebase) param and generates a preSignedURL to for its cloud storage
We need to write a function to upload the videos segments and mpd file to cloud.
As math/rand
uses a statistical random number generator, using a low entropy seed (such as constants and the current system time) may allow an attacker to predict what the following number generated is.
There is 1 occurrence of this issue in the repository.
See all occurrences on DeepSource โ deepsource.io/gh/ZeStream/zestream-server/issue/GO-S1033/occurrences/
We need an endpoint which generates the pre-signed URL for uploading video objects to bucket directly.
Also the cloud-storage should be flexible, like using AWS S3, Google Cloud or Azure can be depending upon the configuration.
Also generate a video Id (7-8 chars) and return it in response
Eg: AWS, Google Cloud, Azure
Is your feature request related to a problem? Please describe.
Enhancement
Describe the solution you'd like
We need to write UT for every function out there
Child Issues
Is your feature request related to a problem? Please describe.
Its a feature
Describe the solution you'd like
Currently, we can only generate AWS pre signed url, we should support GCP and Azure also.
Describe alternatives you've considered
Add support for GCP and Azure also
We need to setup CI for this repo to run tests and generate build (skip this for now)
Calling os.Close
on an io.Closer
may return an error, and ignoring the same might result in a data loss.
There are 3 occurrences of this issue in the repository.
See all occurrences on DeepSource โ deepsource.io/gh/ZeStream/zestream-server/issue/GO-S2307/occurrences/
package main
import (
"fmt"
"os"
)
func foo() error {
f, err := os.Create("/tmp/test.txt")
if err != nil {
return err
}
defer f.Close()
return fmt.Fprint(f, "Hello World")
}
package main
import (
"fmt"
"os"
)
func foo() error {
f, err := os.Create("/tmp/test.txt")
if err != nil {
return err
}
err = fmt.Fprint(f, "Hello World")
if err != nil {
return err
}
return f.Close()
}
package main
import (
"fmt"
"os"
)
func foo() error {
f, err := os.Create("/tmp/test.txt")
if err != nil {
return err
}
defer f.Close()
err = fmt.Fprint(f, "Hello World")
if err != nil {
return err
}
return f.Sync()
}
It is desired to have test cases for the /generate-presigned-url
endpoint which gives a pre-signed url and videoID as output. the s3 SDK is needed to be mocked.
Is your feature request related to a problem? Please describe.
This is a feature request.
Describe the solution you'd like
Write a better Readme for this repo.
Additional context
PIng in #36 for more context.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
We need to add docker support, using a single command, it should deploy an instance on docker
We need to write an Error response schema to be returned from API. Like this
{
"error": "Error parsing JSON request",
"message": "Invalid JSON format",
"detail": "Post the 'author' and 'id' fields in the request body."
"statusCode": 400
}
Either integrate SwaggerUI in Go Gin or write the API doc in Postman.
Before starting, do comment which method(Swagger/Postman) you will be using and Why?
Describe the bug
While setting up the dev environment I noticed that some packages are missing from the direct requirements part of thego.mod
file. Specifically the cloud.google.com/go/storage
package and github.com/Azure/azure-storage-blob-go
package.
To Reproduce
Steps to reproduce the behavior:
go get .
Expected behavior
They should ideally be already in the direct dependency.
Packages exposing functions that can stop program execution by exiting are hard to reuse. Program exits in functions other than main() or init() are not encouraged.
There are 4 occurrences of this issue in the repository.
See all occurrences on DeepSource โ deepsource.io/gh/ZeStream/zestream-server/issue/RVV-A0003/occurrences/
calls to log.Fatal
should be only in main()
or init()
functions. So a possible solution for this could be replacing log.Fatal
with an Error log level
We need to write UTs for all the functions, whose UTs are not written yet.
You can even raise PR with at least 1 UT of a function.
Describe the solution you'd like
Create an endpoint which takes a file path, width and height and returns a file in that dimension.
The URL should look like
/api/v1/image/path-to-file?h=100&w=100
Approach
/path-to-file#hash
) exists on CDNffmpeg
and upload it to CDN, and return the file.Is your feature request related to a problem? Please describe.
Currently we use the traditional golang log package for logging purpose, however its not sufficient as it lacks a lot of basic functionality like an error level log.
Describe the solution you'd like
Use Zap Logger and replace all the occurrence of log package with this one. Also add new logger statements whenever necessary.
Describe alternatives you've considered
logrus
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.