Documentation ¶
Overview ¶
Package ffmpeg lets you access the camera via ffmpeg to stream video and to create snapshots.
This package requires the `ffmpeg` command line tool to be installed. Install by running - `apt-get install ffmpeg` on linux - `brew install ffmpeg` on macOS
HomeKit supports multiple video codecs but h264 is mandatory. So make sure that a h264 decoder for ffmpeg is installed too. Audio streaming is currently not supported.
If you are running a RPi with Raspbian, it is recommended to use a v4l2 loopback device instead of access the camera via `/dev/video0` directly.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Stderr = ioutil.Discard
var Stdout = ioutil.Discard
Functions ¶
func EnableVerboseLogging ¶
func EnableVerboseLogging()
EnableVerboseLogging enables verbose logging of ffmpeg to stdout.
func New ¶
func New(cfg Config) *ffmpeg
New returns a new ffmpeg handle to start and stop video streams and to make snapshots. If cfg specifies a video loopback, ffmpeg configures a loopback to support simultaneous access to the video device.
func NewLoopback ¶
func NewLoopback(inputDevice, inputFilename, loopbackFilename string) *loopback
NewLoopback returns a new video loopback.
Types ¶
type Config ¶
type Config struct { InputDevice string InputFilename string LoopbackFilename string H264Decoder string H264Encoder string MinVideoBitrate int MultiStream bool }
Config contains ffmpeg parameters
type FFMPEG ¶
type FFMPEG interface { PrepareNewStream(rtp.SetupEndpoints, rtp.SetupEndpointsResponse) StreamID Start(StreamID, rtp.VideoParameters, rtp.AudioParameters) error Stop(StreamID) Suspend(StreamID) Resume(StreamID) ActiveStreams() int Reconfigure(StreamID, rtp.VideoParameters, rtp.AudioParameters) error Snapshot(width, height uint) (*image.Image, error) }
FFMPEG lets you interact with camera stream.
type StreamNotFoundError ¶
type StreamNotFoundError struct {
// contains filtered or unexported fields
}
func (*StreamNotFoundError) Error ¶
func (e *StreamNotFoundError) Error() string