View Single Post
  #1  
Old 07-07-2014, 04:20 AM
sebastian sebastian is offline
Member
 
Join Date: Jun 2007
Posts: 81
sebastian is on a distinguished road
Default

Batch file loop for retrying to record a stream


Hi guys,

I'd like to record unattendendly an m3u8 stream. During my last tries the stream went offline during its broadcast, but than went online again after a few minutes.

So I'd like to record it via a batch file loop, so that I don't have to restart it again:

Code:
@echo off
:start
ffmpeg -i http://streamlocation.m3u8 -c copy filename.ts
timeout 120
goto :start
This should work, but the batch file is missing an option to generate a new filename (maybe filename.ts added with a sequence number) each time the loop starts again. Anyone with an idea?

Best
Sebastian
Reply With Quote