diff --git a/README.md b/README.md index e108515..f5b8809 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ Close() type Options struct { Bitrate int // Bitrate. Loop int // For GIFs only. -1=no loop, 0=infinite loop, >0=number of loops. - Delay int // Delay for final frame of GIFs. + Delay int // Delay for final frame of GIFs in centiseconds. Macro int // Macroblock size for determining how to resize frames for codecs. FPS float64 // Frames per second for output video. Quality float64 // If bitrate not given, use quality instead. Must be between 0 and 1. 0:best, 1:worst. diff --git a/camera.go b/camera.go index 400ab02..a5c18fd 100644 --- a/camera.go +++ b/camera.go @@ -25,6 +25,7 @@ type Camera struct { cmd *exec.Cmd // ffmpeg command. } +// Camera device name. func (camera *Camera) Name() string { return camera.name } @@ -37,10 +38,12 @@ func (camera *Camera) Height() int { return camera.height } +// Channels of video frames. func (camera *Camera) Depth() int { return camera.depth } +// Frames per second of video. func (camera *Camera) FPS() float64 { return camera.fps } diff --git a/video.go b/video.go index 546e2fb..9ecbbfe 100644 --- a/video.go +++ b/video.go @@ -45,7 +45,7 @@ func (video *Video) Depth() int { return video.depth } -// Bitrate of video. +// Bitrate of video in bits/s. func (video *Video) Bitrate() int { return video.bitrate } @@ -60,10 +60,12 @@ func (video *Video) Stream() int { return video.stream } +// Video duration in seconds. func (video *Video) Duration() float64 { return video.duration } +// Frames per second of video. func (video *Video) FPS() float64 { return video.fps } diff --git a/videowriter.go b/videowriter.go index 54c7b9a..084a0ea 100644 --- a/videowriter.go +++ b/videowriter.go @@ -31,7 +31,7 @@ type VideoWriter struct { type Options struct { Bitrate int // Bitrate. Loop int // For GIFs only. -1=no loop, 0=infinite loop, >0=number of loops. - Delay int // Delay for final frame of GIFs. + Delay int // Delay for final frame of GIFs in centiseconds. Macro int // Macroblock size for determining how to resize frames for codecs. FPS float64 // Frames per second for output video. Quality float64 // If bitrate not given, use quality instead. Must be between 0 and 1. 0:best, 1:worst. @@ -56,26 +56,32 @@ func (writer *VideoWriter) Height() int { return writer.height } +// Bitrate of video in bits/s. func (writer *VideoWriter) Bitrate() int { return writer.bitrate } +// For GIFs only, defines looping behavior. -1=no loop, 0=infinite loop, >0=number of loops. func (writer *VideoWriter) Loop() int { return writer.loop } +// Delay for final frame of GIFs in centiseconds. func (writer *VideoWriter) Delay() int { return writer.delay } +// Macroblock size for determining how to resize frames for codecs. func (writer *VideoWriter) Macro() int { return writer.macro } +// Frames per second of video. func (writer *VideoWriter) FPS() float64 { return writer.fps } +// Video Codec Quality parameter. Must be between 0 and 1. 0:best, 1:worst. func (writer *VideoWriter) Quality() float64 { return writer.quality }