Skip to content

TheCacophonyProject/go-cptv

Repository files navigation

go-cptv

Build Status

This package implements a Go package for generating and consuming Cacophony Project Thermal Video (CPTV) files. For more details on these files see the specifications:

Example Usage

Writing CPTV Files

import (
    "github.com/TheCacophonyProject/go-cptv"
    "github.com/TheCacophonyProject/go-cptv/cptvframe"
)

type TestCamera struct {
}

func (cam *TestCamera) ResX() int {
    return 200
}

func (cam *TestCamera) ResY() int {
    return 20
}

func writeFrames(frames []*cptvframe.Frame) error {
    camera := new(TestCamera)
    w := cptv.NewFileWriter("out.cptv", camera)
    defer w.Close()
    err := w.WriterHeader("device-name")
    if err != nil {
        return err
    }
    for _, frame := range frames {
        err := w.WriteFrame(frame)
        if err != nil {
            return err
        }
    }
    return nil
}

Reading CPTV Files

See cptvtool for a read example.

About

Go package for creating and reading Cacophony Project Thermal Video (CPTV) files

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages