<p>Edit both videos into one video.</p>

CC BY-SA 3.0
2017-11-12T15:02:34.280Z
The folder contains 50 video files, each about 90MB. I would like to have all the videos playing in a seamless loop. when i take out **-fflags +genpts -stream_loop -1** from the code it loops with the (**:start, goto start command**) however this generates continuity errors. How can i make all the videos loop seamlessly?
James Patterson
CC BY-SA 3.0
2017-11-12T04:19:44.867Z
2017-11-12T04:19:44.867Z
Goglplx
<p>I am using the code below as a batch file. The issue i am currently having is only one video in the folder keeps looping. How can i make all the videos play and loop?</p>

<pre><code>@echo off

set FFMPEGDIR=E:\ffmpeg\bin
set BARKERDIR=E:\slatewithsound
:start
for /F %%x in ('dir /b /d %BARKERDIR%\*.ts') do (
    @echo %BARKERDIR%\%%x 
    %FFMPEGDIR%\ffmpeg.exe -re -fflags +genpts -stream_loop -1 -i %BARKERDIR%\%%x -acodec ac3 -ac 2 -ar 48000 -b:a 192K -vcodec mpeg2video -s 1920x1080 -b:v 4.5M -mpegts_start_pid 0x101 -mpegts_pmt_start_pid 0x100 -f mpegts udp://239.203.1.61:4000?pkt_size=1316
)
goto start
</code></pre>

CC BY-SA 3.0
2018-01-11T12:30:40.460Z
Have you tried using ffmpeg concatenation? https://trac.ffmpeg.org/wiki/Concatenate
mcont
<ffmpeg>
How to loop .TS files from Folder with FFMPEG
James Patterson
# How to loop .TS files from Folder with FFMPEG

(Asked by: username_0 on 2017-11-12)

I am using the code below as a batch file. The issue i am currently having is only one video in the folder keeps looping. How can i make all the videos play and loop?
@echo off

set FFMPEGDIR=E:\ffmpeg\bin
set BARKERDIR=E:\slatewithsound
:start
for /F %%x in ('dir /b /d %BARKERDIR%\*.ts') do (
    @echo %BARKERDIR%\%%x 
    %FFMPEGDIR%\ffmpeg.exe -re -fflags +genpts -stream_loop -1 -i %BARKERDIR%\%%x -acodec ac3 -ac 2 -ar 48000 -b:a 192K -vcodec mpeg2video -s 1920x1080 -b:v 4.5M -mpegts_start_pid 0x101 -mpegts_pmt_start_pid 0x100 -f mpegts udp://239.203.1.61:4000?pkt_size=1316
)
goto start

**Tags:** ffmpeg

> **Comments:**
> **username_1**: Have you tried using ffmpeg concatenation? https://trac.ffmpeg.org/wiki/Concatenate  

---

## 1 answers

### Answer by username_2 on 2017-11-12. Score: -1

Edit both videos into one video.

> **Comments:**
> **username_0**: The folder contains 50 video files, each about 90MB. I would like to have all the videos playing in a seamless loop. when i take out **-fflags +genpts -stream_loop -1** from the code it loops with the (**:start, goto start command**) however this generates continuity errors. How can i make all the videos loop seamlessly?  

---

