mirror of
https://github.com/arut/nginx-rtmp-module.git
synced 2025-08-06 15:00:18 +08:00
fixed metadata output
This commit is contained in:
@ -272,6 +272,10 @@ ngx_rtmp_codec_update_meta(ngx_rtmp_session_t *s)
|
|||||||
|
|
||||||
static ngx_rtmp_amf_elt_t out_inf[] = {
|
static ngx_rtmp_amf_elt_t out_inf[] = {
|
||||||
|
|
||||||
|
{ NGX_RTMP_AMF_STRING,
|
||||||
|
ngx_string("Server"),
|
||||||
|
"NGINX RTMP (www.github.com/arut/nginx-rtmp-module)", 0 },
|
||||||
|
|
||||||
{ NGX_RTMP_AMF_NUMBER,
|
{ NGX_RTMP_AMF_NUMBER,
|
||||||
ngx_string("width"),
|
ngx_string("width"),
|
||||||
&v.width, 0 },
|
&v.width, 0 },
|
||||||
@ -280,6 +284,14 @@ ngx_rtmp_codec_update_meta(ngx_rtmp_session_t *s)
|
|||||||
ngx_string("height"),
|
ngx_string("height"),
|
||||||
&v.height, 0 },
|
&v.height, 0 },
|
||||||
|
|
||||||
|
{ NGX_RTMP_AMF_NUMBER,
|
||||||
|
ngx_string("displayWidth"),
|
||||||
|
&v.width, 0 },
|
||||||
|
|
||||||
|
{ NGX_RTMP_AMF_NUMBER,
|
||||||
|
ngx_string("displayHeight"),
|
||||||
|
&v.height, 0 },
|
||||||
|
|
||||||
{ NGX_RTMP_AMF_NUMBER,
|
{ NGX_RTMP_AMF_NUMBER,
|
||||||
ngx_string("duration"),
|
ngx_string("duration"),
|
||||||
&v.duration, 0 },
|
&v.duration, 0 },
|
||||||
@ -323,10 +335,6 @@ ngx_rtmp_codec_update_meta(ngx_rtmp_session_t *s)
|
|||||||
ngx_null_string,
|
ngx_null_string,
|
||||||
"onMetaData", 0 },
|
"onMetaData", 0 },
|
||||||
|
|
||||||
{ NGX_RTMP_AMF_STRING,
|
|
||||||
ngx_null_string,
|
|
||||||
NULL, 0 },
|
|
||||||
|
|
||||||
{ NGX_RTMP_AMF_OBJECT,
|
{ NGX_RTMP_AMF_OBJECT,
|
||||||
ngx_null_string,
|
ngx_null_string,
|
||||||
out_inf, sizeof(out_inf) },
|
out_inf, sizeof(out_inf) },
|
||||||
|
@ -637,6 +637,21 @@ ngx_rtmp_record_av(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
|
|||||||
if (codec_ctx) {
|
if (codec_ctx) {
|
||||||
ch = *h;
|
ch = *h;
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/* metadata */
|
||||||
|
if (codec_ctx->meta) {
|
||||||
|
ngx_log_debug0(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
|
||||||
|
"record: writing metadata");
|
||||||
|
ch.type = NGX_RTMP_MSG_AMF_META;
|
||||||
|
ch.mlen = ngx_rtmp_record_get_chain_mlen(codec_ctx->meta);
|
||||||
|
if (ngx_rtmp_record_write_frame(s, &ch, codec_ctx->meta)
|
||||||
|
!= NGX_OK)
|
||||||
|
{
|
||||||
|
return NGX_OK;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/* AAC header */
|
||||||
if (codec_ctx->aac_header && (racf->flags & NGX_RTMP_RECORD_AUDIO))
|
if (codec_ctx->aac_header && (racf->flags & NGX_RTMP_RECORD_AUDIO))
|
||||||
{
|
{
|
||||||
ngx_log_debug0(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
|
ngx_log_debug0(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
|
||||||
@ -650,6 +665,7 @@ ngx_rtmp_record_av(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* AVC header */
|
||||||
if (codec_ctx->avc_header && (racf->flags
|
if (codec_ctx->avc_header && (racf->flags
|
||||||
& (NGX_RTMP_RECORD_VIDEO|NGX_RTMP_RECORD_KEYFRAMES)))
|
& (NGX_RTMP_RECORD_VIDEO|NGX_RTMP_RECORD_KEYFRAMES)))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user