The server is sending video frame. I would like to use them in order to do a streaming. I wonder how I could assemble the frames to create a streaming video. So far, I could display the frames as pictures. Below is my angular code
component angular
getVideo() {
interval(250).switchMap(() => this.appService.getPictures())
.subscribe(data => {
const file = new Blob([data], {type:'image/png'});
this.url = this.sanitizer.bypassSecurityTrustResourceUrl(URL.createObjectURL(file));
})
}
template html
<img div="test" [src]="url" width="400px" height="300px"/>
I am trying to change the picture using the frame rate of the camera. But my picture is not updated and it freezes my browser due to the high number of http requests.
What I want to achieve is to buffer the frame in order to use the video
tag instead of the img
tag the same way I would connect to a live streaming send by a server using the video
tag with src
set to the url
of the server.
Github link: https://github.com/kedevked/frameProcessing
from turn video frames to streaming video
No comments:
Post a Comment