user12389: Basically I have 4 movies I would like to stream in a continuous loop (ie: like a 24/7 tv channel).
Here is the ./test.txt list of videos:
file 'video1.mp4'
file 'video2.mp4'
file 'videoN.mp4'

Here is the ffmpeg command:
ffmpeg -re -stream_loop -1 -f concat -safe 0 -i ./test.txt -bsf:v h264_mp4toannexb -c copy ./test.m3u8

It starts to play the stream and I think it even loops, as the video files are 10 second clips...but then I get an error "Illegal Seek".
Here is the output:
$ ffmpeg -re -stream_loop -1 -f concat -safe 0 -i ./test.txt -bsf:v h264_mp4toannexb -c copy ./test.m3u8
ffmpeg version 3.1.1 Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 7.3.0 (clang-703.0.31)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/3.1.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --disable-lzma --enable-vda
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 47.100 /  6. 47.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
[matroska,webm @ 0x7f9791809c00] Auto-inserting h264_mp4toannexb bitstream filter
Input #0, concat, from './test.txt':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc
    Metadata:
      HANDLER_NAME    : VideoHandler
      DURATION        : 00:00:10.046000000
    Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, fltp
    Metadata:
      DURATION        : 00:00:10.001000000
[hls @ 0x7f979105a600] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
    Last message repeated 1 times
Output #0, hls, to './test.m3u8':
  Metadata:
    encoder         : Lavf57.41.100
    Stream #0:0: Video: h264, yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
    Metadata:
      HANDLER_NAME    : VideoHandler
      DURATION        : 00:00:10.046000000
    Stream #0:1(eng): Audio: opus, 48000 Hz, stereo
    Metadata:
      DURATION        : 00:00:10.001000000
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
Error while filtering: Illegal seek time=00:00:09.60 bitrate=N/A speed=   1x
frame=  220 fps= 22 q=-1.0 Lsize=N/A time=00:00:09.98 bitrate=N/A speed=0.998x
video:4821kB audio:152kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

I'm unclear what I'm doing wrong. I tried with just one file entry in test.txt list of movies and it still chokes.

user24258: ffmpeg concat demuxer supports nested scripts 
 with the header "ffconcat version 1.0".
Example of endless recursive playlist script "test.txt":
ffconcat version 1.0
file 'video1.mp4'
file 'video2.mp4'
file 'video3.mp4'
file 'test.txt'

ffmpeg command: 
ffmpeg -re -f concat -i ./test.txt  -c copy -f flv rtmp://....

Note: all file paths must be "safe", 
  because the header "concat version 1.0" also resets the safe option to 1.

12389: <p>Basically I have 4 movies I would like to stream in a continuous loop (ie: like a 24/7 tv channel).</p>

<p>Here is the ./test.txt list of videos:</p>

<pre><code>file 'video1.mp4'
file 'video2.mp4'
file 'videoN.mp4'
</code></pre>

<p>Here is the ffmpeg command:</p>

<pre><code>ffmpeg -re -stream_loop -1 -f concat -safe 0 -i ./test.txt -bsf:v h264_mp4toannexb -c copy ./test.m3u8
</code></pre>

<p>It starts to play the stream and I think it even loops, as the video files are 10 second clips...but then I get an error "Illegal Seek".</p>

<p>Here is the output:</p>

<pre><code>$ ffmpeg -re -stream_loop -1 -f concat -safe 0 -i ./test.txt -bsf:v h264_mp4toannexb -c copy ./test.m3u8
ffmpeg version 3.1.1 Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 7.3.0 (clang-703.0.31)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/3.1.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --disable-lzma --enable-vda
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 47.100 /  6. 47.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
[matroska,webm @ 0x7f9791809c00] Auto-inserting h264_mp4toannexb bitstream filter
Input #0, concat, from './test.txt':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc
    Metadata:
      HANDLER_NAME    : VideoHandler
      DURATION        : 00:00:10.046000000
    Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, fltp
    Metadata:
      DURATION        : 00:00:10.001000000
[hls @ 0x7f979105a600] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
    Last message repeated 1 times
Output #0, hls, to './test.m3u8':
  Metadata:
    encoder         : Lavf57.41.100
    Stream #0:0: Video: h264, yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
    Metadata:
      HANDLER_NAME    : VideoHandler
      DURATION        : 00:00:10.046000000
    Stream #0:1(eng): Audio: opus, 48000 Hz, stereo
    Metadata:
      DURATION        : 00:00:10.001000000
Stream mapping:
  Stream #0:0 -&gt; #0:0 (copy)
  Stream #0:1 -&gt; #0:1 (copy)
Press [q] to stop, [?] for help
Error while filtering: Illegal seek time=00:00:09.60 bitrate=N/A speed=   1x
frame=  220 fps= 22 q=-1.0 Lsize=N/A time=00:00:09.98 bitrate=N/A speed=0.998x
video:4821kB audio:152kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
</code></pre>

<p>I'm unclear what I'm doing wrong. I tried with just one <code>file</code> entry in <code>test.txt</code> list of movies and it still chokes.</p>
 24258: <p>ffmpeg concat demuxer supports nested scripts 
 with the header "<em>ffconcat version 1.0</em>".</p>

<p>Example of endless recursive playlist script "<em>test.txt</em>":</p>

<pre><code>ffconcat version 1.0
file 'video1.mp4'
file 'video2.mp4'
file 'video3.mp4'
file 'test.txt'
</code></pre>

<p>ffmpeg command: </p>

<pre><code>ffmpeg -re -f concat -i ./test.txt  -c copy -f flv rtmp://....
</code></pre>

<p>Note: all file paths must be "safe", 
  because the header "concat version 1.0" also resets the <em>safe</em> option to 1.</p>
