Answers.Body: <p>The reason is because HLS as a source is really just a static file (a bunch of .TS packets).  This requires you feed the new ffmpeg process (in your case RTMP) at x1 speed, or real time.  You can do this with the <code>-re</code> flag before the input.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-04T19:18:11.787Z
Answers.LastActivityDate: 2016-11-04T19:18:11.787Z
Answers.UserDisplayName: Jordan Rumph
Body: <p>So my problem is this:</p>
  
  <p>I have a main process that is using as source bmdcapture, that process is creating a set of 4 different streams using HLS, so the command is something like this (showing only one to simplify):</p>
  
  <pre><code>ffmpeg -i /data/pipe0 hls_time 10 /data/input0/out.m3u8
  </code></pre>
  
  <p>That works awesome! No problem at all. Now, if I se that output as input for another stream, it works ok. So, if I do:</p>
  
  <pre><code>ffmpeg -i /data/input0/out.m3u8 hls_time 10 /data/input1/out.m3u8
  </code></pre>
  
  <p>It works ok, no problem at all. I can play it and it works ok.</p>
  
  <p>However, the problem is if I want to use that first HLS to do RTMP streaming... the video gets corrupted, it jumps, sometimes it does not play at all... etc. Is worth to mention, I'm using Akamai to sent the package, but if I use wowza, the same thing happens.</p>
  
  <p>But, I have the solution. Use 2 seconds segments, like this:</p>
  
  <pre><code>ffmpeg -i /data/input0/out.m3u8 hls_time 2 rtmp://akamai.end.point/file
  </code></pre>
  
  <p>And just by doing that change, the stream works flawlessly without problems. However, the main process I have (<code>ffmpeg -i /data/pipe0 hls_time 10 /data/input0/out.m3u8</code>) I need it to be 10 seconds, instead of 2, so I cannot change it... one solution could be create something else in the middle, but that adds complexity specially because this system runs 24/7, so that is not an option... </p>
  
  <p>The question is: why I cannot stream using 10s segments as the source?</p>
  
Tags: <streaming><rtmp>
Title: Stream using HLS as source fails
UserDisplayName: AbrahamSustaita
ThreadText: # Stream using HLS as source fails
  
  (Asked by: username_0 on 2016-10-20)
  
  So my problem is this:
  
  I have a main process that is using as source bmdcapture, that process is creating a set of 4 different streams using HLS, so the command is something like this (showing only one to simplify):
  
  ```
  ffmpeg -i /data/pipe0 hls_time 10 /data/input0/out.m3u8
  
  ```
  
  That works awesome! No problem at all. Now, if I se that output as input for another stream, it works ok. So, if I do:
  
  ```
  ffmpeg -i /data/input0/out.m3u8 hls_time 10 /data/input1/out.m3u8
  
  ```
  
  It works ok, no problem at all. I can play it and it works ok.
  
  However, the problem is if I want to use that first HLS to do RTMP streaming... the video gets corrupted, it jumps, sometimes it does not play at all... etc. Is worth to mention, I'm using Akamai to sent the package, but if I use wowza, the same thing happens.
  
  But, I have the solution. Use 2 seconds segments, like this:
  
  ```
  ffmpeg -i /data/input0/out.m3u8 hls_time 2 rtmp://akamai.end.point/file
  
  ```
  
  And just by doing that change, the stream works flawlessly without problems. However, the main process I have (`ffmpeg -i /data/pipe0 hls_time 10 /data/input0/out.m3u8`) I need it to be 10 seconds, instead of 2, so I cannot change it... one solution could be create something else in the middle, but that adds complexity specially because this system runs 24/7, so that is not an option...
  
  The question is: why I cannot stream using 10s segments as the source?
  
  **Tags:** streaming, rtmp
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-11-04. Score: 1 | Accepted answer
  
  The reason is because HLS as a source is really just a static file (a bunch of .TS packets). This requires you feed the new ffmpeg process (in your case RTMP) at x1 speed, or real time. You can do this with the `-re` flag before the input.
  
  
  ---
  
  