diff --git a/CHANGELOG.md b/CHANGELOG.md index df862886..3b9d3060 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,10 @@ - Fix parsing S3 storage definition from environment variable - Fix checking length of CPU time array ([#10](https://github.com/datarhei/core/issues/10)) - Fix memory consumption of memfs +- Fix possible infinite loop with HLS session rewriter +- Fix not propagating process limits +- Fix URL validation if the path contains FFmpeg specific placeholders +- Fix RTMP DoS attack (thx Johannes Frank) - Deprecate ENV names that do not correspond to JSON name ### Core v16.11.0 > v16.12.0 diff --git a/docs/docs.go b/docs/docs.go index 71b0cc22..1ce43ec3 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -2291,6 +2291,10 @@ const docTemplate = `{ "looping": { "type": "boolean" }, + "looping_runtime": { + "type": "integer", + "format": "uint64" + }, "output": { "$ref": "#/definitions/api.AVstreamIO" }, diff --git a/docs/swagger.json b/docs/swagger.json index bf9b3e7d..0448d3aa 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -2284,6 +2284,10 @@ "looping": { "type": "boolean" }, + "looping_runtime": { + "type": "integer", + "format": "uint64" + }, "output": { "$ref": "#/definitions/api.AVstreamIO" }, diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 8b4ac91f..823bf662 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -22,6 +22,9 @@ definitions: $ref: '#/definitions/api.AVstreamIO' looping: type: boolean + looping_runtime: + format: uint64 + type: integer output: $ref: '#/definitions/api.AVstreamIO' queue: diff --git a/ffmpeg/parse/types.go b/ffmpeg/parse/types.go index 18d4464f..0b2a3c60 100644 --- a/ffmpeg/parse/types.go +++ b/ffmpeg/parse/types.go @@ -57,33 +57,35 @@ func (avio *ffmpegAVstreamIO) export() AVstreamIO { } type ffmpegAVstream struct { - Input ffmpegAVstreamIO `json:"input"` - Output ffmpegAVstreamIO `json:"output"` - Address string `json:"id"` - URL string `json:"url"` - Stream uint64 `json:"stream"` - Aqueue uint64 `json:"aqueue"` - Queue uint64 `json:"queue"` - Dup uint64 `json:"dup"` - Drop uint64 `json:"drop"` - Enc uint64 `json:"enc"` - Looping bool `json:"looping"` - Duplicating bool `json:"duplicating"` - GOP string `json:"gop"` + Input ffmpegAVstreamIO `json:"input"` + Output ffmpegAVstreamIO `json:"output"` + Address string `json:"id"` + URL string `json:"url"` + Stream uint64 `json:"stream"` + Aqueue uint64 `json:"aqueue"` + Queue uint64 `json:"queue"` + Dup uint64 `json:"dup"` + Drop uint64 `json:"drop"` + Enc uint64 `json:"enc"` + Looping bool `json:"looping"` + LoopingRuntime uint64 `json:"looping_runtime"` + Duplicating bool `json:"duplicating"` + GOP string `json:"gop"` } func (av *ffmpegAVstream) export() *AVstream { return &AVstream{ - Aqueue: av.Aqueue, - Queue: av.Queue, - Drop: av.Drop, - Dup: av.Dup, - Enc: av.Enc, - Looping: av.Looping, - Duplicating: av.Duplicating, - GOP: av.GOP, - Input: av.Input.export(), - Output: av.Output.export(), + Aqueue: av.Aqueue, + Queue: av.Queue, + Drop: av.Drop, + Dup: av.Dup, + Enc: av.Enc, + Looping: av.Looping, + LoopingRuntime: av.LoopingRuntime, + Duplicating: av.Duplicating, + GOP: av.GOP, + Input: av.Input.export(), + Output: av.Output.export(), } } @@ -310,16 +312,17 @@ type AVstreamIO struct { } type AVstream struct { - Input AVstreamIO - Output AVstreamIO - Aqueue uint64 - Queue uint64 - Dup uint64 - Drop uint64 - Enc uint64 - Looping bool - Duplicating bool - GOP string + Input AVstreamIO + Output AVstreamIO + Aqueue uint64 + Queue uint64 + Dup uint64 + Drop uint64 + Enc uint64 + Looping bool + LoopingRuntime uint64 + Duplicating bool + GOP string } type Usage struct { diff --git a/http/api/avstream.go b/http/api/avstream.go index 279b3352..91c6c5e7 100644 --- a/http/api/avstream.go +++ b/http/api/avstream.go @@ -23,16 +23,17 @@ func (i *AVstreamIO) Unmarshal(io *app.AVstreamIO) { } type AVstream struct { - Input AVstreamIO `json:"input"` - Output AVstreamIO `json:"output"` - Aqueue uint64 `json:"aqueue" format:"uint64"` - Queue uint64 `json:"queue" format:"uint64"` - Dup uint64 `json:"dup" format:"uint64"` - Drop uint64 `json:"drop" format:"uint64"` - Enc uint64 `json:"enc" format:"uint64"` - Looping bool `json:"looping"` - Duplicating bool `json:"duplicating"` - GOP string `json:"gop"` + Input AVstreamIO `json:"input"` + Output AVstreamIO `json:"output"` + Aqueue uint64 `json:"aqueue" format:"uint64"` + Queue uint64 `json:"queue" format:"uint64"` + Dup uint64 `json:"dup" format:"uint64"` + Drop uint64 `json:"drop" format:"uint64"` + Enc uint64 `json:"enc" format:"uint64"` + Looping bool `json:"looping"` + LoopingRuntime uint64 `json:"looping_runtime" format:"uint64"` + Duplicating bool `json:"duplicating"` + GOP string `json:"gop"` } func (a *AVstream) Unmarshal(av *app.AVstream) { @@ -46,6 +47,7 @@ func (a *AVstream) Unmarshal(av *app.AVstream) { a.Drop = av.Drop a.Enc = av.Enc a.Looping = av.Looping + a.LoopingRuntime = av.LoopingRuntime a.Duplicating = av.Duplicating a.GOP = av.GOP diff --git a/restream/app/avstream.go b/restream/app/avstream.go index 70cf9634..988a18cb 100644 --- a/restream/app/avstream.go +++ b/restream/app/avstream.go @@ -3,19 +3,20 @@ package app type AVstreamIO struct { State string Packet uint64 // counter - Time uint64 + Time uint64 // sec Size uint64 // bytes } type AVstream struct { - Input AVstreamIO - Output AVstreamIO - Aqueue uint64 // gauge - Queue uint64 // gauge - Dup uint64 // counter - Drop uint64 // counter - Enc uint64 // counter - Looping bool - Duplicating bool - GOP string + Input AVstreamIO + Output AVstreamIO + Aqueue uint64 // gauge + Queue uint64 // gauge + Dup uint64 // counter + Drop uint64 // counter + Enc uint64 // counter + Looping bool + LoopingRuntime uint64 // sec + Duplicating bool + GOP string } diff --git a/restream/restream.go b/restream/restream.go index b3febfaa..39a10def 100644 --- a/restream/restream.go +++ b/restream/restream.go @@ -1509,14 +1509,15 @@ func convertProgressFromParser(progress *app.Progress, pprogress parse.Progress) Time: pinput.AVstream.Output.Time, Size: pinput.AVstream.Output.Size, }, - Aqueue: pinput.AVstream.Aqueue, - Queue: pinput.AVstream.Queue, - Dup: pinput.AVstream.Dup, - Drop: pinput.AVstream.Drop, - Enc: pinput.AVstream.Enc, - Looping: pinput.AVstream.Looping, - Duplicating: pinput.AVstream.Duplicating, - GOP: pinput.AVstream.GOP, + Aqueue: pinput.AVstream.Aqueue, + Queue: pinput.AVstream.Queue, + Dup: pinput.AVstream.Dup, + Drop: pinput.AVstream.Drop, + Enc: pinput.AVstream.Enc, + Looping: pinput.AVstream.Looping, + LoopingRuntime: pinput.AVstream.LoopingRuntime, + Duplicating: pinput.AVstream.Duplicating, + GOP: pinput.AVstream.GOP, } input.AVstream = avstream