VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 11 of 11
Thread
  1. hey guys,

    I always record live streams with FFmpeg with the command ffmpeg -i "stream url" -c copy stream.ts

    and wonderd if there is a way to automatically re-start the bat if the streams disconnects for a few seconds. Or if it is possible that the bat won't shut down when the stream disconnects and just pauses and continues after the stream is back on.
    Does anyone have any idea how that would be possible ?

    thanks guys
    regards
    -Gwar
    Quote Quote  
  2. Found this - does it work?
    Quote Quote  
  3. I haven't tested this but maybe:

    Code:
    :START
    ffmpeg -y -i "stream url" -c copy stream.ts
    if errorlevel 1 goto START
    It won't pick up where it left off though.
    Quote Quote  
  4. Yes, it would overwrite the file and you lose everything except the last session. In the link I found they used >> but I haven't tested it.
    Quote Quote  
  5. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    Setting the truncate option to FALSE may keep it from overwriting.

    Code:
    ffmpeg -i "stream url" -c copy -truncate 0 stream.ts
    Quote Quote  
  6. Shure overwriting the file would be pretty bad. I tested that script but it won't even start the batch

    I tried 7 different methods but that bat shuts down a half second after start

    ffmpeg <URL> -t -c copy test.ts
    ffmpeg <URL> -t -c copy test.ts
    ffmpeg hls+<URL> -t -c copy test.ts
    ffmpeg hls+<URL> -t 10 -c copy test.ts
    ffmpeg <URL> -t 10 -c copy test.ts
    ffmpeg <URL> -t 10 test.ts
    ffmpeg <URL> -t test.ts

    Maybe I'm not getting it and doing something wrong ?
    Quote Quote  
  7. Originally Posted by JVRaines View Post
    Setting the truncate option to FALSE may keep it from overwriting.

    Code:
    ffmpeg -i "stream url" -c copy -truncate 0 stream.ts
    thanks this one starts the batch. So I should use the scrip just as you wrote it or should I use it as

    ffmpeg -i "stream url" -c copy -truncate false stream.ts ?

    or does the zero mean "false" ?

    thanks
    Quote Quote  
  8. Add "pause" on the line after ffmpeg... and see what error message you get.
    Quote Quote  
  9. the stream starts and I'm working with "ffmpeg -i "stream url" -c copy -truncate 0 stream.ts" I let you know if it records untl the end without shutdown thanks guys
    Quote Quote  
  10. Hi ,
    Here below what I should do :
    Code:
    @echo on
    
    :BEGIN
    set ladate1=%date:~0,2%-%date:~3,2%-%date:~6,4%
    if "%TIME:~0,1%"==" " (set ext=0%TIME:~1,1%H%time:~3,2%mn%time:~6,2%) else (set ext=%TIME:~0,2%H%time:~3,2%mn%time:~6,2%)
    
    :START
    ffmpeg -y -i "stream url" -c copy stream_%ladate1%_%ext%.ts
    if errorlevel 1 goto BEGIN
    
    pause
    :fin
    Cheers .
    JE SUIS CHARLIE !!!
    Quote Quote  
  11. Or use youtube-dl instead of ffmpeg. It officially supports picking up where it left off.
    Quote Quote  



Similar Threads