|
|
|
@ -2338,6 +2338,12 @@ int srs_human_print_rtmp_packet4(char type, u_int32_t timestamp, char* data, int
|
|
|
|
|
pi = (pre_now - starttime) / (double)nb_packets;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// global fps(video and audio mixed fps).
|
|
|
|
|
double gfps = 0;
|
|
|
|
|
if (pi > 0) {
|
|
|
|
|
gfps = 1000 / pi;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int diff = 0;
|
|
|
|
|
if (pre_timestamp > 0) {
|
|
|
|
|
diff = (int)timestamp - (int)pre_timestamp;
|
|
|
|
@ -2350,22 +2356,22 @@ int srs_human_print_rtmp_packet4(char type, u_int32_t timestamp, char* data, int
|
|
|
|
|
|
|
|
|
|
u_int32_t pts;
|
|
|
|
|
if (srs_utils_parse_timestamp(timestamp, type, data, size, &pts) != 0) {
|
|
|
|
|
srs_human_trace("Rtmp packet id=%"PRId64"/%.1f, type=%s, dts=%d, diff=%d, ndiff=%d, size=%d, DecodeError",
|
|
|
|
|
nb_packets, pi, srs_human_flv_tag_type2string(type), timestamp, diff, ndiff, size
|
|
|
|
|
srs_human_trace("Rtmp packet id=%"PRId64"/%.1f/%.1f, type=%s, dts=%d, diff=%d, ndiff=%d, size=%d, DecodeError",
|
|
|
|
|
nb_packets, pi, gfps, srs_human_flv_tag_type2string(type), timestamp, diff, ndiff, size
|
|
|
|
|
);
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (type == SRS_RTMP_TYPE_VIDEO) {
|
|
|
|
|
srs_human_trace("Video packet id=%"PRId64"/%.1f, type=%s, dts=%d, pts=%d, diff=%d, ndiff=%d, size=%d, %s(%s,%s)",
|
|
|
|
|
nb_packets, pi, srs_human_flv_tag_type2string(type), timestamp, pts, diff, ndiff, size,
|
|
|
|
|
srs_human_trace("Video packet id=%"PRId64"/%.1f/%.1f, type=%s, dts=%d, pts=%d, diff=%d, ndiff=%d, size=%d, %s(%s,%s)",
|
|
|
|
|
nb_packets, pi, gfps, srs_human_flv_tag_type2string(type), timestamp, pts, diff, ndiff, size,
|
|
|
|
|
srs_human_flv_video_codec_id2string(srs_utils_flv_video_codec_id(data, size)),
|
|
|
|
|
srs_human_flv_video_avc_packet_type2string(srs_utils_flv_video_avc_packet_type(data, size)),
|
|
|
|
|
srs_human_flv_video_frame_type2string(srs_utils_flv_video_frame_type(data, size))
|
|
|
|
|
);
|
|
|
|
|
} else if (type == SRS_RTMP_TYPE_AUDIO) {
|
|
|
|
|
srs_human_trace("Audio packet id=%"PRId64"/%.1f, type=%s, dts=%d, pts=%d, diff=%d, ndiff=%d, size=%d, %s(%s,%s,%s,%s)",
|
|
|
|
|
nb_packets, pi, srs_human_flv_tag_type2string(type), timestamp, pts, diff, ndiff, size,
|
|
|
|
|
srs_human_trace("Audio packet id=%"PRId64"/%.1f/%.1f, type=%s, dts=%d, pts=%d, diff=%d, ndiff=%d, size=%d, %s(%s,%s,%s,%s)",
|
|
|
|
|
nb_packets, pi, gfps, srs_human_flv_tag_type2string(type), timestamp, pts, diff, ndiff, size,
|
|
|
|
|
srs_human_flv_audio_sound_format2string(srs_utils_flv_audio_sound_format(data, size)),
|
|
|
|
|
srs_human_flv_audio_sound_rate2string(srs_utils_flv_audio_sound_rate(data, size)),
|
|
|
|
|
srs_human_flv_audio_sound_size2string(srs_utils_flv_audio_sound_size(data, size)),
|
|
|
|
@ -2373,8 +2379,8 @@ int srs_human_print_rtmp_packet4(char type, u_int32_t timestamp, char* data, int
|
|
|
|
|
srs_human_flv_audio_aac_packet_type2string(srs_utils_flv_audio_aac_packet_type(data, size))
|
|
|
|
|
);
|
|
|
|
|
} else if (type == SRS_RTMP_TYPE_SCRIPT) {
|
|
|
|
|
srs_human_verbose("Data packet id=%"PRId64"/%.1f, type=%s, time=%d, diff=%d, ndiff=%d, size=%d",
|
|
|
|
|
nb_packets, pi, srs_human_flv_tag_type2string(type), timestamp, diff, ndiff, size);
|
|
|
|
|
srs_human_verbose("Data packet id=%"PRId64"/%.1f/%.1f, type=%s, time=%d, diff=%d, ndiff=%d, size=%d",
|
|
|
|
|
nb_packets, pi, gfps, srs_human_flv_tag_type2string(type), timestamp, diff, ndiff, size);
|
|
|
|
|
int nparsed = 0;
|
|
|
|
|
while (nparsed < size) {
|
|
|
|
|
int nb_parsed_this = 0;
|
|
|
|
@ -2390,8 +2396,8 @@ int srs_human_print_rtmp_packet4(char type, u_int32_t timestamp, char* data, int
|
|
|
|
|
srs_freep(amf0_str);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
srs_human_trace("Rtmp packet id=%"PRId64"/%.1f, type=%#x, dts=%d, pts=%d, diff=%d, ndiff=%d, size=%d",
|
|
|
|
|
nb_packets, pi, type, timestamp, pts, diff, ndiff, size);
|
|
|
|
|
srs_human_trace("Rtmp packet id=%"PRId64"/%.1f/%.1f, type=%#x, dts=%d, pts=%d, diff=%d, ndiff=%d, size=%d",
|
|
|
|
|
nb_packets, pi, gfps, type, timestamp, pts, diff, ndiff, size);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|