From 1a4d215f0a48346bdbeab53d7dc1ae0ba84fc37e Mon Sep 17 00:00:00 2001 From: erankor Date: Sun, 9 Jun 2024 10:00:33 +0300 Subject: [PATCH] ngx-live: fix audio ends before video issue (#208) * ngx-live: fix audio ends before video issue the segmenter may try to cut a segment at the audio end timestamp, there is no video key frame at this timestamp - the video segments come out empty, and some of the audio frames are discarded. then it tries to create another segment, but the segments of all tracks come out empty, and the channel is failed. the fix is to avoid averaging the min/max split pts when the span is too large. in this case, the target pts will be the audio end pts, the video segments will come out empty, and the trailing audio will be discarded. * update readme * update UT --- nginx-live-module/README.md | 9 +++ nginx-live-module/src/ngx_live_segmenter.c | 23 +++++- nginx-live-module/test/nginx.conf | 2 +- .../test/tests/audio_ends_before_video.py | 49 ++++++++++++ .../ref/audio_ends_before_video-hls-fmp4.txt | 75 +++++++++++++++++++ .../ref/audio_ends_before_video-hls-ts.txt | 65 ++++++++++++++++ .../audio_slightly_before_video-hls-fmp4.txt | 19 ++--- .../audio_slightly_before_video-hls-ts.txt | 8 +- .../ref/history_change_track_add-hls-fmp4.txt | 22 +++--- .../ref/history_change_track_add-hls-ts.txt | 25 ++++--- .../ref/inter_frame_pts_jump-hls-fmp4.txt | 38 ++++------ .../tests/ref/inter_frame_pts_jump-hls-ts.txt | 38 ++++------ .../tests/ref/media_type_gaps-hls-fmp4.txt | 32 ++++---- .../test/tests/ref/media_type_gaps-hls-ts.txt | 8 +- 14 files changed, 311 insertions(+), 102 deletions(-) create mode 100644 nginx-live-module/test/tests/audio_ends_before_video.py create mode 100644 nginx-live-module/test/tests/ref/audio_ends_before_video-hls-fmp4.txt create mode 100644 nginx-live-module/test/tests/ref/audio_ends_before_video-hls-ts.txt diff --git a/nginx-live-module/README.md b/nginx-live-module/README.md index a99a7a22..e281ed21 100644 --- a/nginx-live-module/README.md +++ b/nginx-live-module/README.md @@ -1179,6 +1179,15 @@ tweaks the timestamp of the existing candidate instead of adding a new value to Sets a margin around the minimum span for segment pts candidates. When choosing the end pts for a segment, candidates whose span is greater than the minimum span by more than the configured margin are disqualified. +#### segmenter_max_span_average +* **syntax**: `segmenter_max_span_average msec;` +* **default**: `500ms` +* **context**: `live`, `preset` + +Sets a maximum value for averaging the min/max segment split pts values. +When choosing the end pts for a segment, if the difference between the min/max split pts of the different tracks is lower than this value, the average of the min/max is used. +Otherwise, the original candidate pts is used. + #### segmenter_ready_threshold * **syntax**: `segmenter_ready_threshold percent;` * **default**: `150` diff --git a/nginx-live-module/src/ngx_live_segmenter.c b/nginx-live-module/src/ngx_live_segmenter.c index cc0c2ac2..304db34b 100644 --- a/nginx-live-module/src/ngx_live_segmenter.c +++ b/nginx-live-module/src/ngx_live_segmenter.c @@ -59,6 +59,7 @@ typedef struct { ngx_msec_t candidate_margin; ngx_msec_t keyframe_alignment_margin; + ngx_msec_t max_span_average; ngx_uint_t ready_threshold; ngx_uint_t initial_ready_threshold; @@ -208,6 +209,7 @@ typedef struct { uint32_t candidate_margin; uint32_t keyframe_alignment_margin; + uint32_t max_span_average; uint32_t ready_duration; uint32_t initial_ready_duration; @@ -309,6 +311,13 @@ static ngx_command_t ngx_live_segmenter_commands[] = { offsetof(ngx_live_segmenter_preset_conf_t, keyframe_alignment_margin), NULL }, + { ngx_string("segmenter_max_span_average"), + NGX_LIVE_MAIN_CONF|NGX_LIVE_PRESET_CONF|NGX_CONF_TAKE1, + ngx_conf_set_msec_slot, + NGX_LIVE_PRESET_CONF_OFFSET, + offsetof(ngx_live_segmenter_preset_conf_t, max_span_average), + NULL }, + { ngx_string("segmenter_ready_threshold"), NGX_LIVE_MAIN_CONF|NGX_LIVE_PRESET_CONF|NGX_CONF_TAKE1, ngx_conf_set_num_slot, @@ -2391,7 +2400,13 @@ ngx_live_segmenter_get_segment_times(ngx_live_channel_t *channel, continue; } - cur_pts = (max[i] + min[i]) / 2; + if (max[i] - min[i] < cctx->max_span_average) { + cur_pts = (max[i] + min[i]) / 2; + + } else { + cur_pts = candidates.elts[i].pts; + } + if (target_pts == NGX_LIVE_INVALID_PTS || ngx_abs_diff(cur_pts, boundary_pts) < ngx_abs_diff(target_pts, boundary_pts)) @@ -3629,6 +3644,8 @@ ngx_live_segmenter_channel_init(ngx_live_channel_t *channel, void *ectx) spcf->candidate_margin, 1000, channel->timescale); cctx->keyframe_alignment_margin = ngx_live_rescale_time( spcf->keyframe_alignment_margin, 1000, channel->timescale); + cctx->max_span_average = ngx_live_rescale_time( + spcf->max_span_average, 1000, channel->timescale); cctx->create.data = channel; cctx->create.handler = ngx_live_segmenter_create_handler; @@ -3890,6 +3907,7 @@ ngx_live_segmenter_create_preset_conf(ngx_conf_t *cf) conf->candidate_margin = NGX_CONF_UNSET_MSEC; conf->keyframe_alignment_margin = NGX_CONF_UNSET_MSEC; + conf->max_span_average = NGX_CONF_UNSET_MSEC; conf->ready_threshold = NGX_CONF_UNSET_UINT; conf->initial_ready_threshold = NGX_CONF_UNSET_UINT; @@ -3945,6 +3963,9 @@ ngx_live_segmenter_merge_preset_conf(ngx_conf_t *cf, void *parent, void *child) ngx_conf_merge_msec_value(conf->keyframe_alignment_margin, prev->keyframe_alignment_margin, 500); + ngx_conf_merge_msec_value(conf->max_span_average, + prev->max_span_average, 500); + ngx_conf_merge_uint_value(conf->ready_threshold, prev->ready_threshold, 150); diff --git a/nginx-live-module/test/nginx.conf b/nginx-live-module/test/nginx.conf index 9d370ca4..7ce741c7 100644 --- a/nginx-live-module/test/nginx.conf +++ b/nginx-live-module/test/nginx.conf @@ -167,7 +167,7 @@ http { location /ksmp_proxy/ { internal; proxy_pass http://127.0.0.1:8001/ksmp/; - subrequest_output_buffer_size 5m; + subrequest_output_buffer_size 20m; } # curl localhost:8001/sgts///seg--s.ts diff --git a/nginx-live-module/test/tests/audio_ends_before_video.py b/nginx-live-module/test/tests/audio_ends_before_video.py new file mode 100644 index 00000000..d422bb58 --- /dev/null +++ b/nginx-live-module/test/tests/audio_ends_before_video.py @@ -0,0 +1,49 @@ +from test_base import * + +# EXPECTED: +# 16 sec first video + audio +# 2 sec first video, no audio +# 10 sec second video + audio + +def test(channelId=CHANNEL_ID): + st = KmpSendTimestamps() + + nl = setupChannelTimeline(channelId) + + rv = KmpMediaFileReader(TEST_VIDEO_HIGH, 0) + ra = KmpMediaFileReader(TEST_VIDEO_HIGH, 1) + + sv, sa = createVariant(nl, VARIANT_ID, [('v1', 'video'), ('a1', 'audio')]) + + kmpSendStreams([ + (rv, sv), + (ra, sa), + ], st, 17.5, realtime=5) + + kmpSendStreams([ + (rv, sv), + (ra, KmpNullSender()), + ], st, 2, realtime=5) + + kmpSendEndOfStream([sv, sa]) + + time.sleep(2) + + initialFrameId = 1000000 + + rv = KmpMediaFileReader(TEST_VIDEO1, 0) + ra = KmpMediaFileReader(TEST_VIDEO1, 1) + + sv, sa = createVariant(nl, VARIANT_ID, [('v1', 'video'), ('a1', 'audio')], initialFrameId=initialFrameId) + + kmpSendStreams([ + (rv, sv), + (ra, sa), + ], st, 10, realtime=5) + + kmpSendEndOfStream([sv, sa]) + + # deactivate the timeline + nl.timeline.update(NginxLiveTimeline(id=TIMELINE_ID, end_list='on')) + + testDefaultStreams(channelId, __file__) diff --git a/nginx-live-module/test/tests/ref/audio_ends_before_video-hls-fmp4.txt b/nginx-live-module/test/tests/ref/audio_ends_before_video-hls-fmp4.txt new file mode 100644 index 00000000..e5974db3 --- /dev/null +++ b/nginx-live-module/test/tests/ref/audio_ends_before_video-hls-fmp4.txt @@ -0,0 +1,75 @@ +URL: /master.m3u8 +HEADERS: 200 application/vnd.apple.mpegurl +BODY: #EXTM3U +#EXT-X-INDEPENDENT-SEGMENTS + +#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=126573,AVERAGE-BANDWIDTH=114074,RESOLUTION=160x120,FRAME-RATE=15.000,CODECS="avc1.64000b,mp4a.40.2" +index-svar1.m3u8 + +URL: /index-svar1.m3u8 +HEADERS: 200 application/vnd.apple.mpegurl +BODY: #EXTM3U +#EXT-X-TARGETDURATION:8 +#EXT-X-VERSION:6 +#EXT-X-MEDIA-SEQUENCE:0 +#EXT-X-DISCONTINUITY-SEQUENCE:0 +#EXT-X-INDEPENDENT-SEGMENTS +#EXT-X-ALLOW-CACHE:YES +#EXT-X-MAP:URI="init-1-svar1.mp4" +#EXT-X-PROGRAM-DATE-TIME:2020-01-01T00:00:00.000+00:00 +#EXTINF:8.342, +#EXT-X-BITRATE:4971 +seg-1-svar1.m4s +#EXTINF:7.966, +#EXT-X-BITRATE:16215 +seg-2-svar1.m4s +#EXT-X-DISCONTINUITY +#EXT-X-PROGRAM-DATE-TIME:2020-01-01T00:00:16.342+00:00 +#EXTINF:3.200, +#EXT-X-BITRATE:9141 +seg-3-svar1.m4s +#EXT-X-DISCONTINUITY +#EXT-X-MAP:URI="init-5-svar1.mp4" +#EXT-X-PROGRAM-DATE-TIME:2020-01-01T00:00:19.630+00:00 +#EXTINF:3.956, +#EXT-X-BITRATE:92 +seg-5-svar1.m4s +#EXTINF:3.934, +#EXT-X-BITRATE:123 +seg-6-svar1.m4s +#EXTINF:1.989, +#EXT-X-BITRATE:124 +seg-7-svar1.m4s +#EXT-X-ENDLIST + +URL: /init-1-svar1.mp4 +HEADERS: 200 video/mp4 +BODY: SIZE: 1106, MD5: 44623fdc2bb6eb1183e22c022be3e765 + +URL: /seg-1-svar1.m4s +HEADERS: 200 video/mp4 +BODY: SIZE: 5180236, MD5: 0d015341c4fbb773cfcc90ecbce81d0d + +URL: /seg-2-svar1.m4s +HEADERS: 200 video/mp4 +BODY: SIZE: 16014394, MD5: 309376ada6e59c0222bf0bab74028e1e + +URL: /seg-3-svar1.m4s +HEADERS: 200 video/mp4 +BODY: SIZE: 3732604, MD5: 12a71bf0970f3bafec0a7b800eb51b78 + +URL: /init-5-svar1.mp4 +HEADERS: 200 video/mp4 +BODY: SIZE: 1106, MD5: ca1c220b1d37d697270c21bce220cdef + +URL: /seg-5-svar1.m4s +HEADERS: 200 video/mp4 +BODY: SIZE: 46063, MD5: 3cd142c193f879afc375070a3e30d431 + +URL: /seg-6-svar1.m4s +HEADERS: 200 video/mp4 +BODY: SIZE: 61926, MD5: 8ab6413490c066bb6cbed25d13cdc626 + +URL: /seg-7-svar1.m4s +HEADERS: 200 video/mp4 +BODY: SIZE: 32681, MD5: c03e8d0a6bd6bbb23a5844be89e1b6ea diff --git a/nginx-live-module/test/tests/ref/audio_ends_before_video-hls-ts.txt b/nginx-live-module/test/tests/ref/audio_ends_before_video-hls-ts.txt new file mode 100644 index 00000000..d8a3d604 --- /dev/null +++ b/nginx-live-module/test/tests/ref/audio_ends_before_video-hls-ts.txt @@ -0,0 +1,65 @@ +URL: /master.m3u8 +HEADERS: 200 application/vnd.apple.mpegurl +BODY: #EXTM3U +#EXT-X-INDEPENDENT-SEGMENTS + +#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=144154,AVERAGE-BANDWIDTH=131383,RESOLUTION=160x120,FRAME-RATE=15.000,CODECS="avc1.64000b,mp4a.40.2" +index-svar1.m3u8 + +URL: /index-svar1.m3u8 +HEADERS: 200 application/vnd.apple.mpegurl +BODY: #EXTM3U +#EXT-X-TARGETDURATION:8 +#EXT-X-VERSION:3 +#EXT-X-MEDIA-SEQUENCE:0 +#EXT-X-DISCONTINUITY-SEQUENCE:0 +#EXT-X-INDEPENDENT-SEGMENTS +#EXT-X-ALLOW-CACHE:YES +#EXT-X-PROGRAM-DATE-TIME:2020-01-01T00:00:00.000+00:00 +#EXTINF:8.342, +#EXT-X-BITRATE:5124 +seg-1-svar1.ts +#EXTINF:7.966, +#EXT-X-BITRATE:16612 +seg-2-svar1.ts +#EXT-X-DISCONTINUITY +#EXT-X-PROGRAM-DATE-TIME:2020-01-01T00:00:16.342+00:00 +#EXTINF:3.200, +#EXT-X-BITRATE:9369 +seg-3-svar1.ts +#EXT-X-DISCONTINUITY +#EXT-X-PROGRAM-DATE-TIME:2020-01-01T00:00:19.630+00:00 +#EXTINF:3.956, +#EXT-X-BITRATE:112 +seg-5-svar1.ts +#EXTINF:3.934, +#EXT-X-BITRATE:145 +seg-6-svar1.ts +#EXTINF:1.989, +#EXT-X-BITRATE:152 +seg-7-svar1.ts +#EXT-X-ENDLIST + +URL: /seg-1-svar1.ts +HEADERS: 200 video/mp2t +BODY: SIZE: 5348788, MD5: f120a8a081f82c373c2699c75a46c728 + +URL: /seg-2-svar1.ts +HEADERS: 200 video/mp2t +BODY: SIZE: 16418228, MD5: 7bb081750052c1cb319753d8110c96f5 + +URL: /seg-3-svar1.ts +HEADERS: 200 video/mp2t +BODY: SIZE: 3826740, MD5: 61905a4e992990544087081a6855f90a + +URL: /seg-5-svar1.ts +HEADERS: 200 video/mp2t +BODY: SIZE: 57716, MD5: 9aba89a2ef46c155e15b0f587bad8a61 + +URL: /seg-6-svar1.ts +HEADERS: 200 video/mp2t +BODY: SIZE: 72756, MD5: 57df738394e340264cde12be20eaedfa + +URL: /seg-7-svar1.ts +HEADERS: 200 video/mp2t +BODY: SIZE: 39668, MD5: 4abc468def0cb3c8a592da711861fd1c diff --git a/nginx-live-module/test/tests/ref/audio_slightly_before_video-hls-fmp4.txt b/nginx-live-module/test/tests/ref/audio_slightly_before_video-hls-fmp4.txt index 9007b18b..adeb1e26 100644 --- a/nginx-live-module/test/tests/ref/audio_slightly_before_video-hls-fmp4.txt +++ b/nginx-live-module/test/tests/ref/audio_slightly_before_video-hls-fmp4.txt @@ -33,11 +33,12 @@ seg-4-svar1.m4s seg-5-svar1.m4s #EXTINF:3.800, seg-6-svar1.m4s -#EXTINF:1.597, +#EXTINF:1.195, +#EXT-X-BITRATE:99 seg-7-svar1.m4s #EXT-X-DISCONTINUITY -#EXT-X-PROGRAM-DATE-TIME:2020-01-01T00:00:29.397+00:00 -#EXTINF:4.336, +#EXT-X-PROGRAM-DATE-TIME:2020-01-01T00:00:28.995+00:00 +#EXTINF:4.738, #EXT-X-BITRATE:78 seg-8-svar1.m4s #EXTINF:4.067, @@ -88,25 +89,25 @@ BODY: SIZE: 21196, MD5: 5f436e7fab1fac326b00dd3a6241f25d URL: /seg-8-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 38604, MD5: aab750cf56331fe0a329bb6352e89f99 +BODY: SIZE: 38604, MD5: 783e04da1e617e155070189d87d5948a URL: /seg-9-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 52331, MD5: 63b0a3444ce7f12f62f145e7610fa14c +BODY: SIZE: 52331, MD5: dcf10f79a419278f210037446e932256 URL: /seg-10-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 44810, MD5: abc750f681293d68a11174453a26dcee +BODY: SIZE: 44810, MD5: 2e5551724d2d29acef704d0ff062ddd2 URL: /seg-11-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 45655, MD5: 073ab10b2ac2ec65a0568f4417ea5348 +BODY: SIZE: 45655, MD5: b42ef0f7ab3fc8fe4a5b4191ba0516fd URL: /seg-12-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 47467, MD5: fa6d13f86c8fda55fbeb925e8c38b616 +BODY: SIZE: 47467, MD5: 61937dbdb539af5df5a94702aca4633c URL: /seg-13-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 51946, MD5: 3056b4cad505df810bd7ede0e5a2765b +BODY: SIZE: 51946, MD5: 9ad4f2481e2760b0d6c19435cf5dbaf5 diff --git a/nginx-live-module/test/tests/ref/audio_slightly_before_video-hls-ts.txt b/nginx-live-module/test/tests/ref/audio_slightly_before_video-hls-ts.txt index a5d547fa..a1f21919 100644 --- a/nginx-live-module/test/tests/ref/audio_slightly_before_video-hls-ts.txt +++ b/nginx-live-module/test/tests/ref/audio_slightly_before_video-hls-ts.txt @@ -33,12 +33,12 @@ seg-5-svar1.ts #EXTINF:3.800, #EXT-X-BITRATE:119 seg-6-svar1.ts -#EXTINF:1.597, -#EXT-X-BITRATE:129 +#EXTINF:1.195, +#EXT-X-BITRATE:135 seg-7-svar1.ts #EXT-X-DISCONTINUITY -#EXT-X-PROGRAM-DATE-TIME:2020-01-01T00:00:29.397+00:00 -#EXTINF:4.336, +#EXT-X-PROGRAM-DATE-TIME:2020-01-01T00:00:28.995+00:00 +#EXTINF:4.738, #EXT-X-BITRATE:95 seg-8-svar1.ts #EXTINF:4.067, diff --git a/nginx-live-module/test/tests/ref/history_change_track_add-hls-fmp4.txt b/nginx-live-module/test/tests/ref/history_change_track_add-hls-fmp4.txt index 0154266a..17b61174 100644 --- a/nginx-live-module/test/tests/ref/history_change_track_add-hls-fmp4.txt +++ b/nginx-live-module/test/tests/ref/history_change_track_add-hls-fmp4.txt @@ -3,9 +3,9 @@ HEADERS: 200 application/vnd.apple.mpegurl BODY: #EXTM3U #EXT-X-INDEPENDENT-SEGMENTS -#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=114311,AVERAGE-BANDWIDTH=103529,RESOLUTION=160x120,FRAME-RATE=15.000,CODECS="avc1.64000b,mp4a.40.2" +#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=114311,AVERAGE-BANDWIDTH=103525,RESOLUTION=160x120,FRAME-RATE=15.000,CODECS="avc1.64000b,mp4a.40.2" index-svar1.m3u8 -#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=520558,AVERAGE-BANDWIDTH=467406,RESOLUTION=480x256,FRAME-RATE=25.000,CODECS="avc1.42c01e,mp4a.40.2" +#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=520459,AVERAGE-BANDWIDTH=467424,RESOLUTION=480x256,FRAME-RATE=25.000,CODECS="avc1.42c01e,mp4a.40.2" index-svar2.m3u8 URL: /index-svar1.m3u8 @@ -65,10 +65,10 @@ seg-14-svar1.m4s seg-15-svar1.m4s #EXTINF:3.967, seg-16-svar1.m4s -#EXTINF:3.900, +#EXTINF:4.180, #EXT-X-BITRATE:97 seg-17-svar1.m4s -#EXTINF:3.940, +#EXTINF:3.660, seg-18-svar1.m4s #EXT-X-ENDLIST @@ -130,10 +130,10 @@ seg-15-svar2.m4s #EXTINF:3.967, #EXT-X-BITRATE:519 seg-16-svar2.m4s -#EXTINF:3.900, +#EXTINF:4.180, #EXT-X-BITRATE:464 seg-17-svar2.m4s -#EXTINF:3.940, +#EXTINF:3.660, #EXT-X-BITRATE:410 seg-18-svar2.m4s #EXT-X-ENDLIST @@ -216,11 +216,11 @@ BODY: SIZE: 53817, MD5: 2f4d628356271da975cbbf1ebad3ca39 URL: /seg-17-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 46809, MD5: c1e868d73037d9fe21df7f23ba12b20b +BODY: SIZE: 47471, MD5: 2e37996ce5d8d265f28d78ad667166e7 URL: /seg-18-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 52698, MD5: 509f60ae6cb9c0566d429c7547266d45 +BODY: SIZE: 51996, MD5: 061ff3356329cf9cfd51c62d52ca27f4 URL: /init-1-svar2.mp4 HEADERS: 200 video/mp4 @@ -288,7 +288,7 @@ BODY: SIZE: 89109, MD5: f0607dfee91e2a45d2e410fd16e43552 URL: /init-15-svar2.mp4 HEADERS: 200 video/mp4 -BODY: SIZE: 1100, MD5: 5b2b60ccd535ebc031d02047ab3d1875 +BODY: SIZE: 1100, MD5: 9651fdbe963c89d430b2609dcdc5e72f URL: /seg-15-svar2.m4s HEADERS: 200 video/mp4 @@ -300,9 +300,9 @@ BODY: SIZE: 259774, MD5: 975deffff34bbcac591e9f2923f8d2ac URL: /seg-17-svar2.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 231279, MD5: 03a206822e754504eca628ed5d8cf7cb +BODY: SIZE: 233713, MD5: 09d566c1342570aba6f144dcede05f6d URL: /seg-18-svar2.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 202330, MD5: 7ebe2594d62ceb872e10d033edcbaac8 +BODY: SIZE: 199936, MD5: 97d6bbb62643fac29b6c8f24f4d09a3e diff --git a/nginx-live-module/test/tests/ref/history_change_track_add-hls-ts.txt b/nginx-live-module/test/tests/ref/history_change_track_add-hls-ts.txt index 19e929dd..668d1227 100644 --- a/nginx-live-module/test/tests/ref/history_change_track_add-hls-ts.txt +++ b/nginx-live-module/test/tests/ref/history_change_track_add-hls-ts.txt @@ -3,9 +3,9 @@ HEADERS: 200 application/vnd.apple.mpegurl BODY: #EXTM3U #EXT-X-INDEPENDENT-SEGMENTS -#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=135053,AVERAGE-BANDWIDTH=124032,RESOLUTION=160x120,FRAME-RATE=15.000,CODECS="avc1.64000b,mp4a.40.2" +#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=135053,AVERAGE-BANDWIDTH=124027,RESOLUTION=160x120,FRAME-RATE=15.000,CODECS="avc1.64000b,mp4a.40.2" index-svar1.m3u8 -#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=560338,AVERAGE-BANDWIDTH=506005,RESOLUTION=480x256,FRAME-RATE=25.000,CODECS="avc1.42c01e,mp4a.40.2" +#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=560233,AVERAGE-BANDWIDTH=506024,RESOLUTION=480x256,FRAME-RATE=25.000,CODECS="avc1.42c01e,mp4a.40.2" index-svar2.m3u8 URL: /index-svar1.m3u8 @@ -64,10 +64,11 @@ seg-14-svar1.ts seg-15-svar1.ts #EXTINF:3.967, seg-16-svar1.ts -#EXTINF:3.900, -#EXT-X-BITRATE:118 +#EXTINF:4.180, +#EXT-X-BITRATE:117 seg-17-svar1.ts -#EXTINF:3.940, +#EXTINF:3.660, +#EXT-X-BITRATE:118 seg-18-svar1.ts #EXT-X-ENDLIST @@ -128,11 +129,11 @@ seg-15-svar2.ts #EXTINF:3.967, #EXT-X-BITRATE:559 seg-16-svar2.ts -#EXTINF:3.900, +#EXTINF:4.180, #EXT-X-BITRATE:503 seg-17-svar2.ts -#EXTINF:3.940, -#EXT-X-BITRATE:448 +#EXTINF:3.660, +#EXT-X-BITRATE:449 seg-18-svar2.ts #EXT-X-ENDLIST @@ -202,11 +203,11 @@ BODY: SIZE: 63732, MD5: 7d431feaacf8283f9218f6e95d62e949 URL: /seg-17-svar1.ts HEADERS: 200 video/mp2t -BODY: SIZE: 57716, MD5: f07fc680d001a76915033f6361085c7a +BODY: SIZE: 57716, MD5: 864c61844969b8e9f066f735f29a016a URL: /seg-18-svar1.ts HEADERS: 200 video/mp2t -BODY: SIZE: 63732, MD5: db0514f6f4369a9fe1eb768028191d4c +BODY: SIZE: 63732, MD5: df425d1e2e7163e830c1a418ca3e00f8 URL: /seg-1-svar2.ts HEADERS: 200 video/mp2t @@ -274,9 +275,9 @@ BODY: SIZE: 280308, MD5: 9173c6436fd4bf2f499c22447e2a6894 URL: /seg-17-svar2.ts HEADERS: 200 video/mp2t -BODY: SIZE: 250228, MD5: a3b0de76b4ae9b21f68eefbd509a72f2 +BODY: SIZE: 253236, MD5: 4fae68d0eb68da50a2f4c5a8ab0787b2 URL: /seg-18-svar2.ts HEADERS: 200 video/mp2t -BODY: SIZE: 220148, MD5: b14c4131942c68c3485e64d958987676 +BODY: SIZE: 217140, MD5: fa8b1b4fcf1e2957c3336d5b91be07cd diff --git a/nginx-live-module/test/tests/ref/inter_frame_pts_jump-hls-fmp4.txt b/nginx-live-module/test/tests/ref/inter_frame_pts_jump-hls-fmp4.txt index c78a4b8e..56b59d5e 100644 --- a/nginx-live-module/test/tests/ref/inter_frame_pts_jump-hls-fmp4.txt +++ b/nginx-live-module/test/tests/ref/inter_frame_pts_jump-hls-fmp4.txt @@ -3,7 +3,7 @@ HEADERS: 200 application/vnd.apple.mpegurl BODY: #EXTM3U #EXT-X-INDEPENDENT-SEGMENTS -#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=124111,AVERAGE-BANDWIDTH=107844,RESOLUTION=160x120,FRAME-RATE=15.000,CODECS="avc1.64000b,mp4a.40.2" +#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=124111,AVERAGE-BANDWIDTH=109282,RESOLUTION=160x120,FRAME-RATE=15.000,CODECS="avc1.64000b,mp4a.40.2" index-svar1.m3u8 URL: /index-svar1.m3u8 @@ -34,24 +34,22 @@ seg-5-svar1.m4s #EXT-X-BITRATE:104 seg-6-svar1.m4s #EXT-X-DISCONTINUITY -#EXT-X-PROGRAM-DATE-TIME:2020-01-01T00:00:22.424+00:00 -#EXTINF:1.078, -#EXT-X-BITRATE:89 +#EXT-X-PROGRAM-DATE-TIME:2020-01-01T00:00:22.848+00:00 +#EXTINF:4.952, +#EXT-X-BITRATE:91 seg-7-svar1.m4s -#EXTINF:4.298, -#EXT-X-BITRATE:88 -seg-8-svar1.m4s #EXTINF:3.933, -seg-9-svar1.m4s +#EXT-X-BITRATE:92 +seg-8-svar1.m4s #EXTINF:4.000, #EXT-X-BITRATE:112 -seg-10-svar1.m4s +seg-9-svar1.m4s #EXTINF:4.067, -seg-11-svar1.m4s +seg-10-svar1.m4s #EXTINF:3.933, -seg-12-svar1.m4s +seg-11-svar1.m4s #EXTINF:2.065, -seg-13-svar1.m4s +seg-12-svar1.m4s #EXT-X-ENDLIST URL: /init-1-svar1.mp4 @@ -84,29 +82,25 @@ BODY: SIZE: 26158, MD5: f5a79362beb6b7c7198bbfec1dc96f27 URL: /seg-7-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 19572, MD5: ab96231fae518caad6713a3ba0a1ff66 +BODY: SIZE: 64208, MD5: 0821437c32e37f9f9b0236bd11496cde URL: /seg-8-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 45483, MD5: ce0edc8587f1b37d0332b9cdae24dc12 +BODY: SIZE: 45313, MD5: a145cd9058eba015c2779218f6d32e7d URL: /seg-9-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 45313, MD5: e417532473ac0afd7f59de779f668ee2 +BODY: SIZE: 56155, MD5: b8007ad46ac866adc94f6313d476311d URL: /seg-10-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 56155, MD5: 80d44fe7dd85278496e25474276eff4b +BODY: SIZE: 60466, MD5: 838f57d0c626eab121aae094c86fc9f6 URL: /seg-11-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 60466, MD5: 4f9eb504aa2647246ccb2140d323c148 +BODY: SIZE: 54969, MD5: 0e09946bafab2a5b48374082bd06f92f URL: /seg-12-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 54969, MD5: d8439f2b07dd824b84a1fd9d7dd1f4ae - -URL: /seg-13-svar1.m4s -HEADERS: 200 video/mp4 -BODY: SIZE: 35464, MD5: f5385cf26e60e889cb42820cc942aa47 +BODY: SIZE: 35464, MD5: 05c467c24eb077ef2ced00da15cb08a0 diff --git a/nginx-live-module/test/tests/ref/inter_frame_pts_jump-hls-ts.txt b/nginx-live-module/test/tests/ref/inter_frame_pts_jump-hls-ts.txt index 2b889157..514a5f1a 100644 --- a/nginx-live-module/test/tests/ref/inter_frame_pts_jump-hls-ts.txt +++ b/nginx-live-module/test/tests/ref/inter_frame_pts_jump-hls-ts.txt @@ -3,7 +3,7 @@ HEADERS: 200 application/vnd.apple.mpegurl BODY: #EXTM3U #EXT-X-INDEPENDENT-SEGMENTS -#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=145071,AVERAGE-BANDWIDTH=128446,RESOLUTION=160x120,FRAME-RATE=15.000,CODECS="avc1.64000b,mp4a.40.2" +#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=145071,AVERAGE-BANDWIDTH=129914,RESOLUTION=160x120,FRAME-RATE=15.000,CODECS="avc1.64000b,mp4a.40.2" index-svar1.m3u8 URL: /index-svar1.m3u8 @@ -34,26 +34,24 @@ seg-5-svar1.ts #EXT-X-BITRATE:131 seg-6-svar1.ts #EXT-X-DISCONTINUITY -#EXT-X-PROGRAM-DATE-TIME:2020-01-01T00:00:22.424+00:00 -#EXTINF:1.078, -#EXT-X-BITRATE:128 +#EXT-X-PROGRAM-DATE-TIME:2020-01-01T00:00:22.848+00:00 +#EXTINF:4.952, +#EXT-X-BITRATE:111 seg-7-svar1.ts -#EXTINF:4.298, -#EXT-X-BITRATE:108 -seg-8-svar1.ts #EXTINF:3.933, -seg-9-svar1.ts +#EXT-X-BITRATE:112 +seg-8-svar1.ts #EXTINF:4.000, #EXT-X-BITRATE:132 -seg-10-svar1.ts +seg-9-svar1.ts #EXTINF:4.067, -seg-11-svar1.ts +seg-10-svar1.ts #EXTINF:3.933, #EXT-X-BITRATE:133 -seg-12-svar1.ts +seg-11-svar1.ts #EXTINF:2.065, #EXT-X-BITRATE:139 -seg-13-svar1.ts +seg-12-svar1.ts #EXT-X-ENDLIST URL: /seg-1-svar1.ts @@ -82,29 +80,25 @@ BODY: SIZE: 33652, MD5: 199644143b53f9929adab23c6b31f9e5 URL: /seg-7-svar1.ts HEADERS: 200 video/mp2t -BODY: SIZE: 27636, MD5: d2fe6ef7cd3f1c2fae65c2e63a689765 +BODY: SIZE: 78772, MD5: 3aaf6fec61119dc118640bb9b05fdcb0 URL: /seg-8-svar1.ts HEADERS: 200 video/mp2t -BODY: SIZE: 54708, MD5: 2e8b584f1a162eb6a7bdd8e7bb0a9590 +BODY: SIZE: 57716, MD5: 082c7a81563871af3cbbe2ab69e2d1ae URL: /seg-9-svar1.ts HEADERS: 200 video/mp2t -BODY: SIZE: 57716, MD5: 5052c5f3eab6e958c64ad82f6e9f69a6 +BODY: SIZE: 66740, MD5: 5a55cfe10fcbd56bb3d2167687bfad43 URL: /seg-10-svar1.ts HEADERS: 200 video/mp2t -BODY: SIZE: 66740, MD5: 6bf34473fc35ffc56a75ca6bcd7bb59a +BODY: SIZE: 69748, MD5: da186790796ae6ca40cc959c4b394971 URL: /seg-11-svar1.ts HEADERS: 200 video/mp2t -BODY: SIZE: 69748, MD5: a09ede711c7a462cb812f01e9bc79045 +BODY: SIZE: 66740, MD5: a228a5e89b242ae4c37a9c8098d43e67 URL: /seg-12-svar1.ts HEADERS: 200 video/mp2t -BODY: SIZE: 66740, MD5: f8c59c0ea2afb3fc59dd1d351860a66c - -URL: /seg-13-svar1.ts -HEADERS: 200 video/mp2t -BODY: SIZE: 42676, MD5: 89884f95eeec088f13ef7ec91f771cac +BODY: SIZE: 42676, MD5: 444a04b20c99d3c55dcca7abb0b5aa66 diff --git a/nginx-live-module/test/tests/ref/media_type_gaps-hls-fmp4.txt b/nginx-live-module/test/tests/ref/media_type_gaps-hls-fmp4.txt index dbca8a53..6c85c477 100644 --- a/nginx-live-module/test/tests/ref/media_type_gaps-hls-fmp4.txt +++ b/nginx-live-module/test/tests/ref/media_type_gaps-hls-fmp4.txt @@ -33,12 +33,12 @@ seg-5-svar1.m4s #EXTINF:4.000, #EXT-X-BITRATE:98 seg-6-svar1.m4s -#EXTINF:1.356, +#EXTINF:0.979, #EXT-X-BITRATE:99 seg-7-svar1.m4s #EXT-X-DISCONTINUITY -#EXT-X-PROGRAM-DATE-TIME:2020-01-01T00:00:25.222+00:00 -#EXTINF:4.444, +#EXT-X-PROGRAM-DATE-TIME:2020-01-01T00:00:24.845+00:00 +#EXTINF:4.821, #EXT-X-BITRATE:78 seg-8-svar1.m4s #EXTINF:3.934, @@ -141,55 +141,55 @@ BODY: SIZE: 19341, MD5: 5e438ca92d232f9d099c6ed18493d9c4 URL: /seg-8-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 35926, MD5: b26f49ac9b9c892c6f3661df7bdd5828 +BODY: SIZE: 35926, MD5: 2c9fb3a1ab1c6fbddae20efc1e6bded6 URL: /seg-9-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 38604, MD5: 6ccbfcbd479bb3768e6e3ced8ae9c635 +BODY: SIZE: 38604, MD5: 1192e4a736102a07b9ead7e74a9cd9fd URL: /seg-10-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 52331, MD5: cb332be444b8f2110e17bb70a706da5a +BODY: SIZE: 52331, MD5: 134c6e34d7b2c13c216be7c576d69b13 URL: /seg-11-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 44810, MD5: d7022d6f1a6063acb61caf84ab6c0e7b +BODY: SIZE: 44810, MD5: 139d82af8c87867d7cead0c204bc3d03 URL: /seg-12-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 45655, MD5: dbaaf52c9e6d68bf40e0c2c283d52a94 +BODY: SIZE: 45655, MD5: fda839d56dd533419a15618e3b6145bb URL: /seg-13-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 47467, MD5: 49d5bdc431b2fe42b7c4eadab4e9ead8 +BODY: SIZE: 47467, MD5: 61b711e291e7807b3f6d0c4ef82e97b7 URL: /seg-14-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 55486, MD5: 104946c1029a339ac9aae353b0c98fc3 +BODY: SIZE: 55486, MD5: c037b9a308bc8829781824c34e4ae394 URL: /seg-15-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 53854, MD5: 1494cf132ede536d7484cdc1b804686f +BODY: SIZE: 53854, MD5: 571a3a76cba7ef4358d3ad61ba86804b URL: /seg-16-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 46473, MD5: 898f3ad6da3ef381db618fcb9fd5538a +BODY: SIZE: 46473, MD5: 2e0f443ad6fb44ddb941199d8eb241dd URL: /seg-17-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 44604, MD5: 1129193f3b768f6a76757ef66b1a085e +BODY: SIZE: 44604, MD5: c1dbce6e86b675a474bf260b49f04b14 URL: /seg-18-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 48536, MD5: 8b86fd677b96d147954e4ade8231f9d9 +BODY: SIZE: 48536, MD5: 20cd58e221553d5676585a8ccbeaa12d URL: /seg-19-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 61434, MD5: a2783c0d02c8924c46284e1b6e1ebf9f +BODY: SIZE: 61434, MD5: c1feb728cf0c5d90d4312597dba99b8a URL: /seg-20-svar1.m4s HEADERS: 200 video/mp4 -BODY: SIZE: 22327, MD5: 48638d1d1c83ce38e1a9f111f0bb88ab +BODY: SIZE: 22327, MD5: da4a17b6bedc9373449f8fb709879616 URL: /seg-21-svar1.m4s HEADERS: 200 video/mp4 diff --git a/nginx-live-module/test/tests/ref/media_type_gaps-hls-ts.txt b/nginx-live-module/test/tests/ref/media_type_gaps-hls-ts.txt index fcf1b07d..a71ffdec 100644 --- a/nginx-live-module/test/tests/ref/media_type_gaps-hls-ts.txt +++ b/nginx-live-module/test/tests/ref/media_type_gaps-hls-ts.txt @@ -33,12 +33,12 @@ seg-5-svar1.ts #EXTINF:4.000, #EXT-X-BITRATE:118 seg-6-svar1.ts -#EXTINF:1.356, -#EXT-X-BITRATE:132 +#EXTINF:0.979, +#EXT-X-BITRATE:140 seg-7-svar1.ts #EXT-X-DISCONTINUITY -#EXT-X-PROGRAM-DATE-TIME:2020-01-01T00:00:25.222+00:00 -#EXTINF:4.444, +#EXT-X-PROGRAM-DATE-TIME:2020-01-01T00:00:24.845+00:00 +#EXTINF:4.821, #EXT-X-BITRATE:95 seg-8-svar1.ts #EXTINF:3.934,