Simple Go Audio/Video cutter library using sox and ffmpeg tools.
$ go get github.com/sandovalrr/mediacutter
or using glide
$ glide get github.com/sandovalrr/mediacutter
import (
"github.com/sandovalrr/mediacutter/cutter"
"github.com/sandovalrr/mediacutter/model"
)
//...
//...
audioCutter := cutter.NewAudioCutter(model.CutterOption{
Path: "path_to_audio.mp3",
Samples: 15,
ChunkPath: "path_to_output_folder",
})
audioCutter.Split()
import (
"github.com/sandovalrr/mediacutter/cutter"
"github.com/sandovalrr/mediacutter/model"
)
//...
//...
videoCutter := cutter.NewVideoCutter(model.CutterOption{
Path: "path_to_video.avi",
Samples: 15,
ChunkPath: "path_to_output_folder",
})
videoCutter.Split()
Property | Description | Type |
---|---|---|
Path | Path to source media file | string |
Samples | Time duration in seconds for each splitted chunk | time.Duration |
ChunkPath | Path to output chunk folder | string |
Property | Description | Type | Parameters |
---|---|---|---|
Len | Function that returns duration of media in seconds | Function | - |
Split | Function that split media file and returns an error if something wrong happen | Function | - |
Option | Object instance of CutterOption | CutterOption | - |
Repo | Object instance of CutterRepository | CutterRepository | - |