update
This commit is contained in:
parent
3812babc58
commit
7dd665cea1
3
TODO
3
TODO
@ -16,3 +16,6 @@
|
||||
|
||||
# 2022-10-11
|
||||
1. 解决视频设备延迟->丢帧机制?或者使用tmpfs->RGB到YUV时,双for循环慢,平均在30-50ms
|
||||
|
||||
# 2022-10-18
|
||||
1. 视频稳定在15ms左右,但大分辨率仍然慢
|
||||
|
@ -58,19 +58,6 @@ func (v *PPMStreamDriver) Properties() []prop.Media {
|
||||
|
||||
func (v *PPMStreamDriver) VideoRecord(p prop.Media) (video.Reader, error) {
|
||||
logrus.Debug(p)
|
||||
/*canvas := image.NewYCbCr(
|
||||
image.Rect(0, 0, p.Width, p.Height),
|
||||
image.YCbCrSubsampleRatio420,
|
||||
)
|
||||
|
||||
Y, Cb, Cr := color.RGBToYCbCr(0, 0, 0)
|
||||
for y := 0; y < canvas.Rect.Dy(); y++ {
|
||||
for x := 0; x < canvas.Rect.Dx(); x++ {
|
||||
canvas.Y[canvas.YOffset(x, y)] = Y
|
||||
canvas.Cb[canvas.COffset(x, y)] = Cb
|
||||
canvas.Cr[canvas.COffset(x, y)] = Cr
|
||||
}
|
||||
}*/
|
||||
|
||||
canvas := image.NewRGBA(image.Rect(0, 0, p.Width, p.Height))
|
||||
var (
|
||||
@ -107,7 +94,6 @@ func (v *PPMStreamDriver) VideoRecord(p prop.Media) (video.Reader, error) {
|
||||
draw.Draw(canvas, image.Rect(
|
||||
offsetX, offsetY, offsetX+img.Bounds().Dx(), offsetY+img.Bounds().Dy(),
|
||||
), img, img.Bounds().Min, draw.Over)
|
||||
case <-time.After(time.Second / time.Duration(p.FrameRate)):
|
||||
default:
|
||||
}
|
||||
return canvas, func() {}, nil
|
||||
|
Loading…
Reference in New Issue
Block a user