Answers.Body: <p>You could try using <a href="https://obsproject.com/" rel="nofollow noreferrer">OBS streaming software</a> (which is free), and then check out <a href="https://www.youtube.com/watch?v=t6EFtempbKA" rel="nofollow noreferrer">this tutorial</a> for how to add delay to your stream. Basically you go into the advanced settings of OBS and go to the delay settings. There you can choose to add a delay of your choosing. </p>
  
  <p>You can also record from the software too. Hope that helps.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-07T21:52:47.517Z
Answers.Text: Welcome! Answers that don't include much more than to see a link are discouraged. If the link becomes unavailable, then the answer won't help people in the future. Could you summarize or paraphrase the contents of the tutorial here?
Answers.UserDisplayName: Michael Liebman
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-07T16:09:02.867Z
Answers.LastActivityDate: 2019-02-14T20:00:10.633Z
Answers.LastEditDate: 2019-02-14T20:00:10.633Z
Answers.UserDisplayName: becca
Body: <p>I need some kind of rtsp buffer to delay video. I have a live cam and i need to start recording video on some event. But I need 10-15 seconds before that event too. Idea is to read from camera, use the delay buffer and stream delayed video to another port. Then to start recording from delayed stream on event. So i tried VLC but it can delay displayed video <code>:sout-display-delay=15000</code> as <a href="https://video.stackexchange.com/questions/4977/video-stream-with-delay">mentioned here</a>, and NOT the streamed one <code>:sout-delay-id=1 :sout-delay-delay:15000</code> (Using VLC 1.1.9 cause VLC 2.2.1 breaks if you only mention delay :( )</p>
  
  <p>I used this command for example</p>
  
  <pre><code>vlc -vvv rtsp://10.0.0.5:554/live.sdp :sout=#duplicate{dst=rtp{sdp=rtsp://:8554/live.sdp},delay-id=0,delay-delay=15000} :sout-keep
  </code></pre>
  
  <p>Any other thoughts, applications, experiences?</p>
  
  <p>Ivan</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-11-29T00:07:54.677Z
Comments.Text: Maybe have a look at ffmpeg ? It has a offset option that might work. https://ffmpeg.org/ffmpeg.html#Main-options
Comments.UserDisplayName: Hayden Thring
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-11-29T19:23:28.140Z
Comments.Text: @HaydenThring First I thought that it's a bingo but sadly, `-itsoffset` works only on inputs that are read from files. It has no effect on streams. Furthermore it does work if you set `-re` option but `-re` option is not ment to be used on streams and ffmpeg has problems following the stream with `-re` option i.e. frames are dropped and not correctly ordered :(
Comments.UserDisplayName: ikxx
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-11-29T22:30:25.140Z
Comments.Text: what if you captured to disk, and then start the stream from that file some delay after the capture begins ?
Comments.UserDisplayName: Hayden Thring
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-11-29T22:56:06.897Z
Comments.Text: That would be OK, but I don't have indefinite disk size. And it is difficult to determine at which point to start reading. For several cameras if I would start recording at midnight till the end of the day it would be a mess... In memory delay would be an optimal solution...
Comments.UserDisplayName: ikxx
Tags: <video><streaming><vlc>
Title: How to stream video with delay
UserDisplayName: ikxx
ThreadText: # How to stream video with delay
  
  (Asked by: username_0 on 2015-11-25)
  
  I need some kind of rtsp buffer to delay video. I have a live cam and i need to start recording video on some event. But I need 10-15 seconds before that event too. Idea is to read from camera, use the delay buffer and stream delayed video to another port. Then to start recording from delayed stream on event. So i tried VLC but it can delay displayed video `:sout-display-delay=15000` as [mentioned here](https://video.stackexchange.com/questions/4977/video-stream-with-delay), and NOT the streamed one `:sout-delay-id=1 :sout-delay-delay:15000` (Using VLC 1.1.9 cause VLC 2.2.1 breaks if you only mention delay :( )
  
  I used this command for example
  
  ```
  vlc -vvv rtsp://10.0.0.5:554/live.sdp :sout=#duplicate{dst=rtp{sdp=rtsp://:8554/live.sdp},delay-id=0,delay-delay=15000} :sout-keep
  
  ```
  
  Any other thoughts, applications, experiences?
  
  Ivan
  
  **Tags:** video, streaming, vlc
  
  > **Comments:**
  > **username_1**: Maybe have a look at ffmpeg ? It has a offset option that might work. https://ffmpeg.org/ffmpeg.html#Main-options  
  > **username_0**: @username_1 First I thought that it's a bingo but sadly, `-itsoffset` works only on inputs that are read from files. It has no effect on streams. Furthermore it does work if you set `-re` option but `-re` option is not ment to be used on streams and ffmpeg has problems following the stream with `-re` option i.e. frames are dropped and not correctly ordered :(  
  > **username_1**: what if you captured to disk, and then start the stream from that file some delay after the capture begins ?  
  > **username_0**: That would be OK, but I don't have indefinite disk size. And it is difficult to determine at which point to start reading. For several cameras if I would start recording at midnight till the end of the day it would be a mess... In memory delay would be an optimal solution...  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2019-02-07. Score: 1
  
  You could try using [OBS streaming software](https://obsproject.com/) (which is free), and then check out [this tutorial](https://www.youtube.com/watch?v=t6EFtempbKA) for how to add delay to your stream. Basically you go into the advanced settings of OBS and go to the delay settings. There you can choose to add a delay of your choosing.
  
  You can also record from the software too. Hope that helps.
  
  > **Comments:**
  > **username_3**: Welcome! Answers that don't include much more than to see a link are discouraged. If the link becomes unavailable, then the answer won't help people in the future. Could you summarize or paraphrase the contents of the tutorial here?  
  
  ---
  
  