I've been trying all day long to make my work easier by automatizing a flow. Here's what I got so far:
@echo off
setlocal EnableDelayedExpansion
for /l %%x in (1,1,10) do (
set /a counter=%%x+1
set output=%%x
start /wait ffmpeg.exe -i "blabla/playlist.m3u8" -c copy C:\teste\%%x.ts
)
pause >nul
blabla/playlist.m3u8 is always changing (see the below file) and I'd like to rename the stream (link) with an incremented variable so that the first one will become 1.ts, the second 2.ts and so on.
Supposing that my file (streams.txt) is structerd like this:
blabla1/playlist1.m3u8
blabla2/playlist132.m3u8
blabla3/playlist12.m3u8
blabla4/playlist66.m3u8
...
How can I parse each line from the file in my for loop and rename the stream by incrementing the %%x variable ?
// I am aware of the next syntax: for /F "tokens=*" %%A in (myfile.txt) do [process] %%A but I do not know how to actually apply it in my case