init
This commit is contained in:
commit
fa47df6d89
22 changed files with 1724 additions and 0 deletions
45
model/metadata.go
Normal file
45
model/metadata.go
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
package model
|
||||
|
||||
import "fmt"
|
||||
|
||||
type Chunk struct {
|
||||
FName string `json:"fname"` // just the basename
|
||||
Length float64 `json:"length"`
|
||||
}
|
||||
|
||||
type AudioStream struct {
|
||||
Index int `json:"index"`
|
||||
Lang string `json:"lang"` // there can be multiple instances of the same language! (Frédi és Béni is one example)
|
||||
Title string `json:"title"`
|
||||
Default bool `json:"default"`
|
||||
Codec string `json:"codec"`
|
||||
SampleRate int `json:"sample_rate"`
|
||||
Bitrate int `json:"bitrate"` // !!! <- This is before transcoding (if used!)
|
||||
Channels int `json:"channels"`
|
||||
AudioChunks []Chunk `json:"audio_chunks"`
|
||||
}
|
||||
|
||||
type Resolution struct {
|
||||
Width int `json:"width"`
|
||||
Height int `json:"height"`
|
||||
}
|
||||
|
||||
func (r Resolution) String() string {
|
||||
return fmt.Sprintf("%dx%d", r.Width, r.Height)
|
||||
}
|
||||
|
||||
type VideoStream struct {
|
||||
Resolution Resolution `json:"resolution"`
|
||||
HLSCodecsString string `json:"hls_codecs_string"` // i.e.: avc1.42E01E
|
||||
PeakBitrate int `json:"peak_bitrate"` // for BANDWIDTH - bits per second
|
||||
AvgBitrate int `json:"avg_bitrate"` // for AVERAGE-BANDWIDTH - bits per second
|
||||
FrameRate float64 `json:"frame_rate"`
|
||||
VideoChunks []Chunk `json:"video_chunks"`
|
||||
}
|
||||
|
||||
type MediaMetadata struct {
|
||||
FriendlyName string `json:"friendly_name"`
|
||||
TargetDuration float64 `json:"target_duration"`
|
||||
VideoStream VideoStream `json:"video_stream"`
|
||||
AudioStreams []AudioStream `json:"audio_streams"`
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue