Updated README
This commit is contained in:
parent
723de2fa8a
commit
407e00be43
1 changed files with 42 additions and 42 deletions
84
README.md
84
README.md
|
@ -16,25 +16,25 @@ The `Video` struct stores data about a video file you give it. The code below sh
|
||||||
video := vidio.NewVideo("input.mp4")
|
video := vidio.NewVideo("input.mp4")
|
||||||
for video.Read() {
|
for video.Read() {
|
||||||
// "frame" stores the video frame as a flattened RGB image
|
// "frame" stores the video frame as a flattened RGB image
|
||||||
frame := video.framebuffer // stored as: RGBRGBRGBRGB...
|
frame := video.framebuffer // stored as: RGBRGBRGBRGB...
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
```go
|
```go
|
||||||
type Video struct {
|
type Video struct {
|
||||||
filename string // Video Filename
|
filename string // Video Filename
|
||||||
width int // Width of Frames
|
width int // Width of Frames
|
||||||
height int // Height of Frames
|
height int // Height of Frames
|
||||||
depth int // Depth of Frames
|
depth int // Depth of Frames
|
||||||
bitrate int // Bitrate for video encoding
|
bitrate int // Bitrate for video encoding
|
||||||
frames int // Total number of frames
|
frames int // Total number of frames
|
||||||
duration float64 // Duration in seconds
|
duration float64 // Duration in seconds
|
||||||
fps float64 // Frames per second
|
fps float64 // Frames per second
|
||||||
codec string // Codec used to encode video
|
codec string // Codec used to encode video
|
||||||
pix_fmt string // Pixel format video is stored in
|
pix_fmt string // Pixel format video is stored in
|
||||||
framebuffer []byte // Raw frame data
|
framebuffer []byte // Raw frame data
|
||||||
pipe *io.ReadCloser // Stdout pipe for ffmpeg process
|
pipe *io.ReadCloser // Stdout pipe for ffmpeg process
|
||||||
cmd *exec.Cmd // ffmpeg command
|
cmd *exec.Cmd // ffmpeg command
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -44,15 +44,15 @@ The `Camera` can read from any cameras on the device running Vidio. It takes in
|
||||||
|
|
||||||
```go
|
```go
|
||||||
type Camera struct {
|
type Camera struct {
|
||||||
name string // Camera device name
|
name string // Camera device name
|
||||||
width int // Camera frame width
|
width int // Camera frame width
|
||||||
height int // Camera frame height
|
height int // Camera frame height
|
||||||
depth int // Camera frame depth
|
depth int // Camera frame depth
|
||||||
fps float64 // Camera frames per second
|
fps float64 // Camera frames per second
|
||||||
codec string // Camera codec
|
codec string // Camera codec
|
||||||
framebuffer []byte // Raw frame data
|
framebuffer []byte // Raw frame data
|
||||||
pipe *io.ReadCloser // Stdout pipe for ffmpeg process streaming webcam
|
pipe *io.ReadCloser // Stdout pipe for ffmpeg process streaming webcam
|
||||||
cmd *exec.Cmd // ffmpeg command
|
cmd *exec.Cmd // ffmpeg command
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -73,30 +73,30 @@ The `VideoWriter` is used to write frames to a video file. The only required par
|
||||||
|
|
||||||
```go
|
```go
|
||||||
type Options struct {
|
type Options struct {
|
||||||
bitrate int // Bitrate
|
bitrate int // Bitrate
|
||||||
loop int // For GIFs only. -1=no loop, 0=loop forever, >0=loop n times
|
loop int // For GIFs only. -1=no loop, 0=loop forever, >0=loop n times
|
||||||
delay int // Delay for Final Frame of GIFs. Default -1 (Use same delay as previous frame)
|
delay int // Delay for Final Frame of GIFs. Default -1 (Use same delay as previous frame)
|
||||||
macro int // macro size for determining how to resize frames for codecs. Default 16
|
macro int // macro size for determining how to resize frames for codecs. Default 16
|
||||||
fps float64 // Frames per second. Default 25
|
fps float64 // Frames per second. Default 25
|
||||||
quality float64 // If bitrate not given, use quality instead. Must be between 0 and 1. 0:best, 1:worst
|
quality float64 // If bitrate not given, use quality instead. Must be between 0 and 1. 0:best, 1:worst
|
||||||
codec string // Codec for video. Default libx264
|
codec string // Codec for video. Default libx264
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
```go
|
```go
|
||||||
type VideoWriter struct {
|
type VideoWriter struct {
|
||||||
filename string // Output video filename
|
filename string // Output video filename
|
||||||
width int // Frame width
|
width int // Frame width
|
||||||
height int // Frame height
|
height int // Frame height
|
||||||
bitrate int // Output video bitrate for encoding
|
bitrate int // Output video bitrate for encoding
|
||||||
loop int // Number of times for GIF to loop
|
loop int // Number of times for GIF to loop
|
||||||
delay int // Delay of final frame of GIF
|
delay int // Delay of final frame of GIF
|
||||||
macro int // macro size for determining how to resize frames for codecs
|
macro int // macro size for determining how to resize frames for codecs
|
||||||
fps float64 // Frames per second for output video
|
fps float64 // Frames per second for output video
|
||||||
quality float64 // Used if bitrate not given
|
quality float64 // Used if bitrate not given
|
||||||
codec string // Codec to encode video with
|
codec string // Codec to encode video with
|
||||||
pipe *io.WriteCloser // Stdout pipe of ffmpeg process
|
pipe *io.WriteCloser // Stdout pipe of ffmpeg process
|
||||||
cmd *exec.Cmd // ffmpeg command
|
cmd *exec.Cmd // ffmpeg command
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue