mirror of
https://github.com/datarhei/core.git
synced 2025-10-05 16:07:07 +08:00
Add support for input framerate data from jsonstats patch
This commit is contained in:
41
docs/docs.go
41
docs/docs.go
@@ -3357,6 +3357,20 @@ const docTemplate = `{
|
|||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "uint64"
|
"format": "uint64"
|
||||||
},
|
},
|
||||||
|
"framerate": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"avg": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"max": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"min": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"height": {
|
"height": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "uint64"
|
"format": "uint64"
|
||||||
@@ -4734,18 +4748,7 @@ const docTemplate = `{
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"auth": {
|
"auth": {
|
||||||
"type": "object",
|
"$ref": "#/definitions/value.S3StorageAuth"
|
||||||
"properties": {
|
|
||||||
"enable": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"password": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"username": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"bucket": {
|
"bucket": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
@@ -4769,6 +4772,20 @@ const docTemplate = `{
|
|||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"value.S3StorageAuth": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"enable": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"password": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"username": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securityDefinitions": {
|
"securityDefinitions": {
|
||||||
|
@@ -3350,6 +3350,20 @@
|
|||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "uint64"
|
"format": "uint64"
|
||||||
},
|
},
|
||||||
|
"framerate": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"avg": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"max": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"min": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"height": {
|
"height": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "uint64"
|
"format": "uint64"
|
||||||
@@ -4727,18 +4741,7 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"auth": {
|
"auth": {
|
||||||
"type": "object",
|
"$ref": "#/definitions/value.S3StorageAuth"
|
||||||
"properties": {
|
|
||||||
"enable": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"password": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"username": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"bucket": {
|
"bucket": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
@@ -4762,6 +4765,20 @@
|
|||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"value.S3StorageAuth": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"enable": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"password": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"username": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securityDefinitions": {
|
"securityDefinitions": {
|
||||||
|
@@ -913,6 +913,15 @@ definitions:
|
|||||||
frame:
|
frame:
|
||||||
format: uint64
|
format: uint64
|
||||||
type: integer
|
type: integer
|
||||||
|
framerate:
|
||||||
|
properties:
|
||||||
|
avg:
|
||||||
|
type: number
|
||||||
|
max:
|
||||||
|
type: number
|
||||||
|
min:
|
||||||
|
type: number
|
||||||
|
type: object
|
||||||
height:
|
height:
|
||||||
format: uint64
|
format: uint64
|
||||||
type: integer
|
type: integer
|
||||||
@@ -1898,14 +1907,7 @@ definitions:
|
|||||||
access_key_id:
|
access_key_id:
|
||||||
type: string
|
type: string
|
||||||
auth:
|
auth:
|
||||||
properties:
|
$ref: '#/definitions/value.S3StorageAuth'
|
||||||
enable:
|
|
||||||
type: boolean
|
|
||||||
password:
|
|
||||||
type: string
|
|
||||||
username:
|
|
||||||
type: string
|
|
||||||
type: object
|
|
||||||
bucket:
|
bucket:
|
||||||
type: string
|
type: string
|
||||||
endpoint:
|
endpoint:
|
||||||
@@ -1921,6 +1923,15 @@ definitions:
|
|||||||
use_ssl:
|
use_ssl:
|
||||||
type: boolean
|
type: boolean
|
||||||
type: object
|
type: object
|
||||||
|
value.S3StorageAuth:
|
||||||
|
properties:
|
||||||
|
enable:
|
||||||
|
type: boolean
|
||||||
|
password:
|
||||||
|
type: string
|
||||||
|
username:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
info:
|
info:
|
||||||
contact:
|
contact:
|
||||||
email: hello@datarhei.com
|
email: hello@datarhei.com
|
||||||
|
@@ -98,6 +98,11 @@ type ffmpegProgressIO struct {
|
|||||||
Bitrate float64 `json:"-"` // bit/s
|
Bitrate float64 `json:"-"` // bit/s
|
||||||
Frame uint64 `json:"frame"` // counter
|
Frame uint64 `json:"frame"` // counter
|
||||||
Keyframe uint64 `json:"keyframe"` // counter
|
Keyframe uint64 `json:"keyframe"` // counter
|
||||||
|
Framerate struct {
|
||||||
|
Min float64 `json:"min"`
|
||||||
|
Max float64 `json:"max"`
|
||||||
|
Average float64 `json:"avg"`
|
||||||
|
} `json:"framerate"`
|
||||||
Packet uint64 `json:"packet"` // counter
|
Packet uint64 `json:"packet"` // counter
|
||||||
Extradata uint64 `json:"extradata_size_bytes"` // bytes
|
Extradata uint64 `json:"extradata_size_bytes"` // bytes
|
||||||
FPS float64 `json:"-"` // rate, frames per second
|
FPS float64 `json:"-"` // rate, frames per second
|
||||||
@@ -112,6 +117,9 @@ func (io *ffmpegProgressIO) exportTo(progress *app.ProgressIO) {
|
|||||||
progress.Stream = io.Stream
|
progress.Stream = io.Stream
|
||||||
progress.Frame = io.Frame
|
progress.Frame = io.Frame
|
||||||
progress.Keyframe = io.Keyframe
|
progress.Keyframe = io.Keyframe
|
||||||
|
progress.Framerate.Min = io.Framerate.Min
|
||||||
|
progress.Framerate.Max = io.Framerate.Max
|
||||||
|
progress.Framerate.Average = io.Framerate.Average
|
||||||
progress.Packet = io.Packet
|
progress.Packet = io.Packet
|
||||||
progress.FPS = io.FPS
|
progress.FPS = io.FPS
|
||||||
progress.PPS = io.PPS
|
progress.PPS = io.PPS
|
||||||
|
@@ -7,6 +7,12 @@ import (
|
|||||||
"github.com/datarhei/core/v16/restream/app"
|
"github.com/datarhei/core/v16/restream/app"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type ProgressIOFramerate struct {
|
||||||
|
Min json.Number `json:"min" swaggertype:"number" jsonschema:"type=number"`
|
||||||
|
Max json.Number `json:"max" swaggertype:"number" jsonschema:"type=number"`
|
||||||
|
Average json.Number `json:"avg" swaggertype:"number" jsonschema:"type=number"`
|
||||||
|
}
|
||||||
|
|
||||||
// ProgressIO represents the progress of an ffmpeg input or output
|
// ProgressIO represents the progress of an ffmpeg input or output
|
||||||
type ProgressIO struct {
|
type ProgressIO struct {
|
||||||
ID string `json:"id" jsonschema:"minLength=1"`
|
ID string `json:"id" jsonschema:"minLength=1"`
|
||||||
@@ -21,6 +27,7 @@ type ProgressIO struct {
|
|||||||
Coder string `json:"coder"`
|
Coder string `json:"coder"`
|
||||||
Frame uint64 `json:"frame" format:"uint64"`
|
Frame uint64 `json:"frame" format:"uint64"`
|
||||||
Keyframe uint64 `json:"keyframe" format:"uint64"`
|
Keyframe uint64 `json:"keyframe" format:"uint64"`
|
||||||
|
Framerate ProgressIOFramerate `json:"framerate"`
|
||||||
FPS json.Number `json:"fps" swaggertype:"number" jsonschema:"type=number"`
|
FPS json.Number `json:"fps" swaggertype:"number" jsonschema:"type=number"`
|
||||||
Packet uint64 `json:"packet" format:"uint64"`
|
Packet uint64 `json:"packet" format:"uint64"`
|
||||||
PPS json.Number `json:"pps" swaggertype:"number" jsonschema:"type=number"`
|
PPS json.Number `json:"pps" swaggertype:"number" jsonschema:"type=number"`
|
||||||
@@ -59,6 +66,9 @@ func (i *ProgressIO) Unmarshal(io *app.ProgressIO) {
|
|||||||
i.Coder = io.Coder
|
i.Coder = io.Coder
|
||||||
i.Frame = io.Frame
|
i.Frame = io.Frame
|
||||||
i.Keyframe = io.Keyframe
|
i.Keyframe = io.Keyframe
|
||||||
|
i.Framerate.Min = json.Number(fmt.Sprintf("%.3f", io.Framerate.Min))
|
||||||
|
i.Framerate.Max = json.Number(fmt.Sprintf("%.3f", io.Framerate.Max))
|
||||||
|
i.Framerate.Average = json.Number(fmt.Sprintf("%.3f", io.Framerate.Average))
|
||||||
i.FPS = json.Number(fmt.Sprintf("%.3f", io.FPS))
|
i.FPS = json.Number(fmt.Sprintf("%.3f", io.FPS))
|
||||||
i.Packet = io.Packet
|
i.Packet = io.Packet
|
||||||
i.PPS = json.Number(fmt.Sprintf("%.3f", io.PPS))
|
i.PPS = json.Number(fmt.Sprintf("%.3f", io.PPS))
|
||||||
|
@@ -13,6 +13,11 @@ type ProgressIO struct {
|
|||||||
Coder string
|
Coder string
|
||||||
Frame uint64 // counter
|
Frame uint64 // counter
|
||||||
Keyframe uint64 // counter
|
Keyframe uint64 // counter
|
||||||
|
Framerate struct {
|
||||||
|
Min float64
|
||||||
|
Max float64
|
||||||
|
Average float64
|
||||||
|
}
|
||||||
FPS float64 // rate, frames per second
|
FPS float64 // rate, frames per second
|
||||||
Packet uint64 // counter
|
Packet uint64 // counter
|
||||||
PPS float64 // rate, packets per second
|
PPS float64 // rate, packets per second
|
||||||
|
Reference in New Issue
Block a user