Updated Documentation

This commit is contained in:
Alex Eidt 2022-09-23 19:02:09 -07:00
parent f6eaee9f1f
commit f1c7d31a29
4 changed files with 14 additions and 3 deletions

View file

@ -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.

View file

@ -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
}

View file

@ -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
}

View file

@ -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
}