bluenviron / mediamtx

Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.
MIT License
12.2k stars 1.53k forks source link

No #EXT-X-ENDLIST in stream.m3u8 #1151

Closed yerzhant closed 1 year ago

yerzhant commented 2 years ago

Which version are you using?

v0.20.0

Which operating system are you using?

Describe the issue

Having a ts file with 60s duration and this config:

...
  ~archive/(.*)$:
    runOnDemand: ffmpeg -re -stream_loop 0 -i /cameras/$G1 -c copy -f rtsp rtsp://localhost:$RTSP_PORT/$RTSP_PATH
    runOnDemandStartTimeout: 10s

  archive-1151:
    runOnInit: ffmpeg -v warning -rtsp_transport tcp -i rtsp://*** -c copy -f segment -strftime 1 -segment_time 3600 -segment_format mpegts /cameras/1151/saved_%Y-%m-%d_%H-%M-%S.ts
...

A player receives in index.m3u8 this:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-INDEPENDENT-SEGMENTS

#EXT-X-STREAM-INF:BANDWIDTH=200000,CODECS="avc1.4d0016"
stream.m3u8

and in stream.m3u8 this:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-ALLOW-CACHE:NO
#EXT-X-TARGETDURATION:4
#EXT-X-MEDIA-SEQUENCE:0

#EXT-X-PROGRAM-DATE-TIME:2022-09-14T15:39:34.159Z
#EXTINF:4,
1663169974.ts

There's no #EXT-X-ENDLIST though we're streaming a file with some determined duration. As a result a player does not show progress bar, i.e. one can't fast forward or rewind the video. It's just a LIVE stream.

As we can see below the input stream has duration:

rtsp-server_1  | 2022/09/14 15:51:47 INF [HLS] [muxer archive/1151/saved_2022-09-14_14-09-14.ts] created (requested by 127.0.0.1)
rtsp-server_1  | 2022/09/14 15:51:47 INF [path archive/1151/saved_2022-09-14_14-09-14.ts] runOnDemand command started
rtsp-server_1  | ffmpeg version 5.0.1 Copyright (c) 2000-2022 the FFmpeg developers
rtsp-server_1  |   built with gcc 11.2.1 (Alpine 11.2.1_git20220219) 20220219
rtsp-server_1  |   configuration: --prefix=/usr --enable-avfilter --enable-gnutls --enable-gpl --enable-libass --enable-libmp3lame --enable-libpulse --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libx264 --enable-libx265 --enable-libtheora --enable-libv4l2 --enable-libdav1d --enable-lto --enable-postproc --enable-pic --enable-pthreads --enable-shared --enable-libxcb --enable-librist --enable-libsrt --enable-libssh --enable-libvidstab --disable-stripping --disable-static --disable-librtmp --enable-libaom --enable-libopus --enable-libsoxr --enable-libwebp --enable-vaapi --enable-vdpau --enable-vulkan --enable-libdrm --disable-debug
rtsp-server_1  |   libavutil      57. 17.100 / 57. 17.100
rtsp-server_1  |   libavcodec     59. 18.100 / 59. 18.100
rtsp-server_1  |   libavformat    59. 16.100 / 59. 16.100
rtsp-server_1  |   libavdevice    59.  4.100 / 59.  4.100
rtsp-server_1  |   libavfilter     8. 24.100 /  8. 24.100
rtsp-server_1  |   libswscale      6.  4.100 /  6.  4.100
rtsp-server_1  |   libswresample   4.  3.100 /  4.  3.100
rtsp-server_1  |   libpostproc    56.  3.100 / 56.  3.100
rtsp-server_1  | Input #0, mpegts, from '/cameras/1151/saved_2022-09-14_14-09-14.ts':
rtsp-server_1  |   Duration: 00:01:00.00, start: 301.400000, bitrate: 15 kb/s
rtsp-server_1  |   Program 1
rtsp-server_1  |     Metadata:
rtsp-server_1  |       service_name    : Media Presentation
rtsp-server_1  |       service_provider: FFmpeg
rtsp-server_1  |   Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuvj420p(pc, bt709, progressive), 640x360, 1 fps, 1 tbr, 90k tbn
rtsp-server_1  | 2022/09/14 15:51:47 INF [RTSP] [conn 127.0.0.1:60454] opened
rtsp-server_1  | 2022/09/14 15:51:47 INF [RTSP] [session 822864230] created by 127.0.0.1:60454
rtsp-server_1  | 2022/09/14 15:51:47 INF [RTSP] [session 822864230] is publishing to path 'archive/1151/saved_2022-09-14_14-09-14.ts', with UDP, 1 track (H264)
rtsp-server_1  | 2022/09/14 15:51:47 INF [HLS] [muxer archive/1151/saved_2022-09-14_14-09-14.ts] is converting into HLS, 1 track (H264)
rtsp-server_1  | Output #0, rtsp, to 'rtsp://localhost:8554/archive/1151/saved_2022-09-14_14-09-14.ts':
rtsp-server_1  |   Metadata:
rtsp-server_1  |     encoder         : Lavf59.16.100
rtsp-server_1  |   Stream #0:0: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuvj420p(pc, bt709, progressive), 640x360, q=2-31, 1 fps, 1 tbr, 90k tbn
rtsp-server_1  | Stream mapping:
rtsp-server_1  |   Stream #0:0 -> #0:0 (copy)
rtsp-server_1  | Press [q] to stop, [?] for help

Describe how to replicate the issue

  1. use the config part like aforementioned one.
  2. place some ts file.
  3. start the server.
  4. play it with an hls player.
  5. there should be no progress bar in the player.

Did you attach the server logs?

yes

Did you attach a network dump?

no

github-actions[bot] commented 1 year ago

This issue is being locked automatically because it has been closed for more than 6 months. Please open a new issue in case you encounter a similar problem.