Open ama-ableton opened 8 years ago
I've noticed this problem too, it's happening 100% of the time when using wirecast 10.0. If the empty publish
event is successful then I receive an empty publish_done
Request body received:
{
"app": "source",
"flashver": "Wirecast/FM 1.0 (compatible; MS",
"swfurl": "",
"tcurl": "rtmp://my-rtmp-server/source",
"pageurl": "",
"addr": "x.x.x.x",
"clientid": "670",
"call": "publish",
"name": "",
"type": ""
}
config file:
rtmp {
server {
listen 1935;
ping 30s;
application source {
live on;
wait_key on;
wait_video on;
record all;
record_path /tmp/live/source-records;
record_suffix -%d-%b-%y-%H_%M_%S.flv;
on_publish http://localhost/publish;
on_publish_done http://localhost/unpublish;
on_record_done http://localhost/recorded;
idle_streams off;
hls on;
hls_type event;
hls_path /tmp/live/source_hls;
hls_fragment 2s;
hls_playlist_length 5m;
hls_nested on;
hls_fragment_naming system;
}
}
}
Hi there,
We were facing similar issues with the "done" notification having an empty name
field, and have come up with a patch proposal on our fork. #1305 was submitted as a pull request, but I would be interested in knowing whether that solves your problem as well and whether you have any additional thoughts on the matter. 😉
@PyvesB Thanks for that ! However on my end, the main problem is that I receive this second "publish" event, and I ended up adding special rules to let it through in order to receive the "done" notification. Getting the name is better (I ended up using "clientid" from nginx) but I don't receive it for "record" event. I've tried to look at the code but I'm not a C developer 😄
@PyvesB @Pat-rice I've just been messing around with a similar issue with missing $filename
for exec_record_done
. After lots of messing around with the nginx-rtmp
source code I found the smoking gun to be inside my flash streaming app. I was using ns.publish(null)
to stop the stream which I now changed to ns.close()
. My guess is that ns.publish(null)
was appropriate for Flash Media Server in the cases where recording might be restarted.
What I really don't understand is why my previous version worked fine a few weeks ago. Probably a timing issue of some description, perhaps due to docker or other gremlins on my dev machine.
Hi there,
We were facing similar issues with the "done" notification having an empty
name
field, and have come up with a patch proposal on our fork. #1305 was submitted as a pull request, but I would be interested in knowing whether that solves your problem as well and whether you have any additional thoughts on the matter. 😉
@PyvesB We tried your fork with Wirecast 12.2.1 and same issues still happen as other people reported once you stop streaming in Wirecast:
The below is nginx log when starting/stopping a stream from the same machine using OBS and Wirecast (compare the events after notify: publish):
OBS: 2019/08/31 18:35:45 [info] 574#0: 54 client connected '84.109.29.107' 2019/08/31 18:35:45 [info] 574#0: 54 connect: app='push' args='' flashver='FMLE/3.0 (compatible; FMSc/1.0)' swf_url='rtmp://rtmp.myserver.com/push' tc_url='rtmp://rtmp.myserver.com/push' page_url='' acodecs=0 vcodecs=0 object_encoding=0, client: 84.109.29.107, server: 0.0.0.0:1935 2019/08/31 18:35:45 [info] 574#0: 54 createStream, client: 84.109.29.107, server: 0.0.0.0:1935 2019/08/31 18:35:45 [info] 574#0: 54 publish: name='Z2l5ujA-ZWF6E1' args='' type=live silent=0, client: 84.109.29.107, server: 0.0.0.0:1935 2019/08/31 18:35:45 [info] 574#0: 54 notify: publish '127.0.0.1:4200/rtmp/start', client: 84.109.29.107, server: 0.0.0.0:1935 2019/08/31 18:35:51 [info] 574#0: 54 deleteStream, client: 84.109.29.107, server: 0.0.0.0:1935 2019/08/31 18:35:51 [info] 574#0: 54 notify: publish_done '127.0.0.1:4200/rtmp/stop', client: 84.109.29.107, server: 0.0.0.0:1935 2019/08/31 18:35:51 [info] 574#0: 54 disconnect, client: 84.109.29.107, server: 0.0.0.0:1935 2019/08/31 18:35:51 [info] 574#0: *54 deleteStream, client: 84.109.29.107, server: 0.0.0.0:1935
Wirecast: 2019/08/31 18:34:17 [info] 574#0: 51 client connected '84.109.29.107' 2019/08/31 18:34:18 [info] 574#0: 51 connect: app='push' args='' flashver='Wirecast/FM 1.0 (compatible; MS' swf_url='' tc_url='rtmp://rtmp.myserver.com/push' page_url='' acodecs=1026 vcodecs=128 object_encoding=0, client: 84.109.29.107, server: 0.0.0.0:1935 2019/08/31 18:34:18 [info] 574#0: 51 createStream, client: 84.109.29.107, server: 0.0.0.0:1935 2019/08/31 18:34:18 [info] 574#0: 51 publish: name='Z2l5ujA-ZWF6E1' args='' type=LIVE silent=0, client: 84.109.29.107, server: 0.0.0.0:1935 2019/08/31 18:34:18 [info] 574#0: 51 notify: publish '127.0.0.1:4200/rtmp/start', client: 84.109.29.107, server: 0.0.0.0:1935 2019/08/31 18:34:24 [info] 574#0: 51 publish: name='' args='' type= silent=0, client: 84.109.29.107, server: 0.0.0.0:1935 2019/08/31 18:34:24 [info] 574#0: 51 notify: publish '127.0.0.1:4200/rtmp/start', client: 84.109.29.107, server: 0.0.0.0:1935 2019/08/31 18:34:24 [info] 574#0: 51 disconnect, client: 84.109.29.107, server: 0.0.0.0:1935 2019/08/31 18:34:24 [info] 574#0: *51 deleteStream, client: 84.109.29.107, server: 0.0.0.0:1935
Same issue with Wirecast 13.0.1. This is my suggested solution (from version v1.2.1):
---
ngx_rtmp_exec_module.c | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/ngx_rtmp_exec_module.c b/ngx_rtmp_exec_module.c
index fccd4ba..f94a5f4 100644
--- a/ngx_rtmp_exec_module.c
+++ b/ngx_rtmp_exec_module.c
@@ -1164,28 +1164,30 @@ ngx_rtmp_exec_publish(ngx_rtmp_session_t *s, ngx_rtmp_publish_t *v)
ngx_rtmp_exec_ctx_t *ctx;
ngx_rtmp_exec_app_conf_t *eacf;
- eacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_exec_module);
+ eacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_exec_module);
+
if (eacf == NULL || !eacf->active) {
- goto next;
+ goto next;
}
-
+
if (s->auto_pushed) {
- goto next;
+ goto next;
}
+
+ if (ngx_strlen(v->name) != 0) {
+ if (ngx_rtmp_exec_init_ctx(s, v->name, v->args, NGX_RTMP_EXEC_PUBLISHING)
+ != NGX_OK)
+ {
+ goto next;
+ }
- if (ngx_rtmp_exec_init_ctx(s, v->name, v->args, NGX_RTMP_EXEC_PUBLISHING)
- != NGX_OK)
- {
- goto next;
- }
-
- ngx_rtmp_exec_unmanaged(s, &eacf->conf[NGX_RTMP_EXEC_PUBLISH], "publish");
+ ngx_rtmp_exec_unmanaged(s, &eacf->conf[NGX_RTMP_EXEC_PUBLISH], "publish");
- ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_exec_module);
-
- ngx_rtmp_exec_managed(s, &ctx->push_exec, "push");
+ ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_exec_module);
+ ngx_rtmp_exec_managed(s, &ctx->push_exec, "push");
+ }
next:
return next_publish(s, v);
}
--
2.21.0
I'm having some weird problems where there is a second publish event with no name or type just before an unpublish event. This only happens sometimes, but about 70% of the time. I came across this because the exec_recording_done directive was returning wrong values for $path, $name, $basename etc. where the filename part would be
-1459442871.flv
instead ofstream-1459442871.flv
. I'm assuming because the second publish event has no name, it simply takes the empty string as the name and passes that to to the variables.The behavior is similar to what is referenced in #341 and #351. I'm using Wirecast 6.0.6 to stream to nginx.
nginx version:
My nginx config:
debug log:
Wirecast log: