update
This commit is contained in:
parent
3812babc58
commit
7dd665cea1
5
TODO
5
TODO
@ -15,4 +15,7 @@
|
|||||||
1. 视频设备延迟过高
|
1. 视频设备延迟过高
|
||||||
|
|
||||||
# 2022-10-11
|
# 2022-10-11
|
||||||
1. 解决视频设备延迟->丢帧机制?或者使用tmpfs->RGB到YUV时,双for循环慢,平均在30-50ms
|
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) {
|
func (v *PPMStreamDriver) VideoRecord(p prop.Media) (video.Reader, error) {
|
||||||
logrus.Debug(p)
|
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))
|
canvas := image.NewRGBA(image.Rect(0, 0, p.Width, p.Height))
|
||||||
var (
|
var (
|
||||||
@ -107,7 +94,6 @@ func (v *PPMStreamDriver) VideoRecord(p prop.Media) (video.Reader, error) {
|
|||||||
draw.Draw(canvas, image.Rect(
|
draw.Draw(canvas, image.Rect(
|
||||||
offsetX, offsetY, offsetX+img.Bounds().Dx(), offsetY+img.Bounds().Dy(),
|
offsetX, offsetY, offsetX+img.Bounds().Dx(), offsetY+img.Bounds().Dy(),
|
||||||
), img, img.Bounds().Min, draw.Over)
|
), img, img.Bounds().Min, draw.Over)
|
||||||
case <-time.After(time.Second / time.Duration(p.FrameRate)):
|
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
return canvas, func() {}, nil
|
return canvas, func() {}, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user