Add framerate parameter option to HTTPs

Some HTTP (a.g. JPEG or MJPEG) needs set the input framerate explicitly.
This commit is contained in:
Galindo, Alex
2023-07-06 12:08:49 +02:00
parent f6936f7cee
commit f94cd16cb7
2 changed files with 19 additions and 1 deletions
+5
View File
@@ -144,6 +144,11 @@ func parseArgs(s string) *ffmpeg.Args {
switch s[:i] {
case "http", "https", "rtmp":
args.Input = inputTemplate("http", s, query)
// Some HTTP-JPEG, HTTP-MJPEG needs the input framerate explicitly
if query["framerate"] != nil {
args.Input = "-framerate " + query["framerate"][0] + " " + args.Input
query.Del("framerate")
}
case "rtsp", "rtsps":
// https://ffmpeg.org/ffmpeg-protocols.html#rtsp
// skip unnecessary input tracks