diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index b7622bc09d..e7a4a3d9e1 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -2257,6 +2257,14 @@ static int dash_write_packet(AVFormatContext *s, AVPacket *pkt) if (ret < 0) { return handle_io_open_error(s, ret, os->temp_path); } + + // in streaming mode, the segments are available for playing + // before fully written but the manifest is needed so that + // clients and discover the segment filenames. + if (c->streaming && os->segment_type == SEGMENT_TYPE_MP4) { + write_manifest(s, 0); + } + if (c->lhls) { char *prefetch_url = use_rename ? NULL : os->filename; write_hls_media_playlist(os, s, pkt->stream_index, 0, prefetch_url);