Nginx-rtmp-module: RTMP publish URL & parameters length limit

Created on 27 Feb 2014  Â·  13Comments  Â·  Source: arut/nginx-rtmp-module

Try to publish with many parameters, so the RTMP URL length is about 700. And I found many parameters not passed to the on_publish callback, and in the rtmp log, I found the URL is just clipped to about 300 characters.

Any documentation or how to overcome this?

Most helpful comment

NGX_RTMP_MAX_NAME at ngx_rtmp_cmd_module.h limitation is 256 bytes
Just increase it.

All 13 comments

I think you have problems with GET.
POST should handle any size

I don't understand, I think RTMP verbs are PUBLISH/PLAY etc.

If you means the on_publish callback, I follow the wiki and write

 on_publish http://api...../publish

No way to specify GET or POST, and in the http app side, I do only accept POST and I found the RTMP module POST to that URL too.

It seems the URL is clipped before the on_publish callback, the RTMP log

 111.193.192.163 [27/Feb/2014:08:19:03 +0000] PUBLISH "live" "vecio" "uid=xxxxxxxxxxxx&token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&product=hammerhead&androidLocale=en_US&androidSDKInt=19&fingerprint=google/hammerhead/hammerhead:4.4.2/KOT49H/937116:user/release-keys&androidVersion=4.4.2&model=Nexus 5&hardware=ha" - 1298 292 "" "" (2s)

You can find the all the parts after hardware=hammerhead is clipped to hardware=ha

@notedit Thanks for the info. But it doesn't fix this issue. The default is POST, and the URL seems to be clipped in the nginx rtmp module before the on_publish callback called. See my previous RTMP log.

In POST query it doesn't matter, becuase your URL is limited only, but your URL it's not that long.

Maybe you've set limits on your api side? Max body length?

@misiek08 I'm using the default POST notify method, and the URL is clipped in the module, see my previous RTMP log, the module may use some fix length char array for the URL.

But what have url with post data? If url is too long then you use GET method.

@misiek08 I think the RTMP uses URL, right?

rtmp://somehost.com/live/stream?uid=xxxxxxxxxxxx&token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&product=hammerhead&androidLocale=en_US&androidSDKInt=19&fingerprint=google/hammerhead/hammerhead:4.4.2/KOT49H/937116:user/release-keys&androidVersion=4.4.2&model=Nexus 5&hardware=ha AND MANY CHARS

It's clipped in the RTMP log

Ah, there. I thought about the http://api..../publish.

Did you try with another streaming software? Here you use something like GET, so that's the problem.

Maybe you can use any other way? Register that data with token in separate POST request and give only token to RTMP.

@misiek08 Currently I'm using another HTTP POST request, and think one RTMP request may be easier. Don't know why the URL length is limited to so short.

NGX_RTMP_MAX_NAME at ngx_rtmp_cmd_module.h limitation is 256 bytes
Just increase it.

@cedricfung May I ask how you resolve the issue? I am coming across the same issue, that is, I want to pass a quite long token in the RTMP PUBLISH url with some other parameters which are much shorter, and the url is clipped.

I haven't solved this issue, so I just write my own streaming server
without using this module any more.

On Tue, Nov 14, 2017 at 11:36 AM, lisadeng notifications@github.com wrote:

@cedricfung https://github.com/cedricfung May I ask how you resolve the
issue? I am coming across the same issue, that is, I want to pass a quite
long token in the RTMP PUBLISH url with some other parameters which are
much shorter, and the url is clipped.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/arut/nginx-rtmp-module/issues/358#issuecomment-344136567,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACKgNu1KdC806b117aOTSqijMFRuFddjks5s2QrOgaJpZM4BlXZj
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fishfree picture fishfree  Â·  4Comments

sheldonbaker picture sheldonbaker  Â·  5Comments

SmokE-PGF picture SmokE-PGF  Â·  6Comments

sfmth picture sfmth  Â·  6Comments

MikuPanda picture MikuPanda  Â·  4Comments