| | 80 | }}} |
| | 81 | |
| | 82 | ==== Changing playlist files on the fly ==== |
| | 83 | |
| | 84 | The concat demuxer opens the referenced files only when they are needed. This allows us to swap the referenced files atomically behind the demuxers back to be able to use the concat demuxer as a changeable live source. Check out the following example file list.txt: |
| | 85 | |
| | 86 | {{{ |
| | 87 | ffconcat version 1.0 |
| | 88 | file dummy.mxf |
| | 89 | file dummy.mxf |
| | 90 | }}} |
| | 91 | |
| | 92 | dummy.mxf is referenced twice to make sure the concat demuxer reopens the file when it reaches it. Combine this with infinite looping and you are done: |
| | 93 | |
| | 94 | {{{ |
| | 95 | ffmpeg -re -stream_loop -1 -i list.txt -flush_packets 0 -f mpegts udp://127.0.0.1:5000?pkt_size=1316 |
| | 96 | }}} |
| | 97 | |
| | 98 | Now you can change the looping clip by a simple move command: |
| | 99 | |
| | 100 | {{{ |
| | 101 | mv next_clip.mxf dummy.mxf |