mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
mediamtx: 1.12.2 -> 1.12.3 (#411557)
This commit is contained in:
commit
7e9accc2a7
2 changed files with 17 additions and 13 deletions
|
@ -1,5 +1,8 @@
|
||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
rtmpUrl = "rtmp://localhost:1935/test";
|
||||||
|
in
|
||||||
{
|
{
|
||||||
name = "mediamtx";
|
name = "mediamtx";
|
||||||
meta.maintainers = with lib.maintainers; [ fpletz ];
|
meta.maintainers = with lib.maintainers; [ fpletz ];
|
||||||
|
@ -23,8 +26,8 @@
|
||||||
DynamicUser = true;
|
DynamicUser = true;
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
RestartSec = "1s";
|
RestartSec = "1s";
|
||||||
TimeoutStartSec = "10s";
|
TimeoutStartSec = "30s";
|
||||||
ExecStart = "${lib.getBin pkgs.ffmpeg-headless}/bin/ffmpeg -re -f lavfi -i smptebars=size=800x600:rate=10 -c libx264 -f flv rtmp://localhost:1935/test";
|
ExecStart = "${lib.getBin pkgs.ffmpeg-headless}/bin/ffmpeg -re -f lavfi -i smptebars=size=800x600:rate=10 -c libx264 -f flv ${rtmpUrl}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -33,12 +36,13 @@
|
||||||
after = [ "rtmp-publish.service" ];
|
after = [ "rtmp-publish.service" ];
|
||||||
bindsTo = [ "rtmp-publish.service" ];
|
bindsTo = [ "rtmp-publish.service" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
unitConfig.StartLimitIntervalSec = 0;
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
DynamicUser = true;
|
DynamicUser = true;
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
RestartSec = "1s";
|
RestartSec = "1s";
|
||||||
TimeoutStartSec = "10s";
|
TimeoutStartSec = "30s";
|
||||||
ExecStart = "${lib.getBin pkgs.ffmpeg-headless}/bin/ffmpeg -y -re -i rtmp://localhost:1935/test -f flv /dev/null";
|
ExecStart = "${lib.getBin pkgs.ffmpeg-headless}/bin/ffmpeg -y -re -i ${rtmpUrl} -f flv /dev/null";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -48,11 +52,11 @@
|
||||||
start_all()
|
start_all()
|
||||||
|
|
||||||
machine.wait_for_unit("mediamtx.service")
|
machine.wait_for_unit("mediamtx.service")
|
||||||
|
|
||||||
machine.wait_for_unit("rtmp-publish.service")
|
machine.wait_for_unit("rtmp-publish.service")
|
||||||
machine.sleep(10)
|
machine.wait_until_succeeds("curl http://localhost:9998/metrics | grep '^rtmp_conns.*state=\"publish\".*1$'")
|
||||||
|
|
||||||
machine.wait_for_unit("rtmp-receive.service")
|
machine.wait_for_unit("rtmp-receive.service")
|
||||||
machine.wait_for_open_port(9998)
|
machine.wait_until_succeeds("curl http://localhost:9998/metrics | grep '^rtmp_conns.*state=\"read\".*1$'")
|
||||||
machine.succeed("curl http://localhost:9998/metrics | grep '^rtmp_conns.*state=\"publish\".*1$'")
|
|
||||||
machine.succeed("curl http://localhost:9998/metrics | grep '^rtmp_conns.*state=\"read\".*1$'")
|
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,23 +8,23 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
hlsJs = fetchurl {
|
hlsJs = fetchurl {
|
||||||
url = "https://cdn.jsdelivr.net/npm/hls.js@v1.5.20/dist/hls.min.js";
|
url = "https://cdn.jsdelivr.net/npm/hls.js@v1.6.2/dist/hls.min.js";
|
||||||
hash = "sha256-0BbBIwSW7lnz9bAcFszkzAG1odPTV63sIAyQixMevkk=";
|
hash = "sha256-5lAT3DQ1tVo0tSV6fmWDWSbB9NVyCduomoENNQX08UM=";
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
buildGoModule (finalAttrs: {
|
buildGoModule (finalAttrs: {
|
||||||
pname = "mediamtx";
|
pname = "mediamtx";
|
||||||
# check for hls.js version updates in internal/servers/hls/hlsjsdownloader/VERSION
|
# check for hls.js version updates in internal/servers/hls/hlsjsdownloader/VERSION
|
||||||
version = "1.12.2";
|
version = "1.12.3";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "bluenviron";
|
owner = "bluenviron";
|
||||||
repo = "mediamtx";
|
repo = "mediamtx";
|
||||||
tag = "v${finalAttrs.version}";
|
tag = "v${finalAttrs.version}";
|
||||||
hash = "sha256-O3Iu9gvCiAVuoJw77MWPyCfuJVcw0E8YWcJBiJq+/Ms=";
|
hash = "sha256-2eTvRWFSR6sXnUJJPKvzQhSqbg1Unh8QuxmyixAw8Cc=";
|
||||||
};
|
};
|
||||||
|
|
||||||
vendorHash = "sha256-0927IeFIC2rhApPVs5ZIvS3yoDN8Km3tHgrRXnP/wBc=";
|
vendorHash = "sha256-CdJS+RebJA6CpOo6YLlTpCXzE0eWSAnWzVXECvgMBvc=";
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
cp ${hlsJs} internal/servers/hls/hls.min.js
|
cp ${hlsJs} internal/servers/hls/hls.min.js
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue