Documentation ¶
Overview ¶
Package mjpeg implements mjpeg streaming handlers with a simple API.
Example ¶
stream := func() (image.Image, error) { img := image.NewGray(image.Rect(0, 0, 100, 100)) for i := 0; i < 100; i++ { for j := 0; j < 100; j++ { n := rand.Intn(256) gray := color.Gray{uint8(n)} img.SetGray(i, j, gray) } } return img, nil } handler := Handler{ Next: stream, Options: &jpeg.Options{Quality: 60}, } mux := http.NewServeMux() mux.Handle("/stream", handler) log.Fatal(http.ListenAndServe(":8080", mux))
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorEndOfStream = errors.New("End of Motion JPEG Stream")
ErrorEndOfStream signals the end of the Motion JPEG frames from a MJPEG stream
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.