diff --git a/ngx_rtmp_codec_module.c b/ngx_rtmp_codec_module.c index 6392231..75d60bf 100644 --- a/ngx_rtmp_codec_module.c +++ b/ngx_rtmp_codec_module.c @@ -272,6 +272,10 @@ ngx_rtmp_codec_update_meta(ngx_rtmp_session_t *s) 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_string("width"), &v.width, 0 }, @@ -280,6 +284,14 @@ ngx_rtmp_codec_update_meta(ngx_rtmp_session_t *s) ngx_string("height"), &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_string("duration"), &v.duration, 0 }, @@ -323,10 +335,6 @@ ngx_rtmp_codec_update_meta(ngx_rtmp_session_t *s) ngx_null_string, "onMetaData", 0 }, - { NGX_RTMP_AMF_STRING, - ngx_null_string, - NULL, 0 }, - { NGX_RTMP_AMF_OBJECT, ngx_null_string, out_inf, sizeof(out_inf) }, diff --git a/ngx_rtmp_record_module.c b/ngx_rtmp_record_module.c index 6f96605..16d0c67 100644 --- a/ngx_rtmp_record_module.c +++ b/ngx_rtmp_record_module.c @@ -637,6 +637,21 @@ ngx_rtmp_record_av(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h, if (codec_ctx) { 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)) { 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 & (NGX_RTMP_RECORD_VIDEO|NGX_RTMP_RECORD_KEYFRAMES))) {