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