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
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://
goto start

Edit both videos into one video.

  • 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 Nov 12 '17 at 15:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.