<p>It's not the best variant, but in my case it helped. I getting data with ffmpeg then routing output to vlc2 via pipe and transmitting it to rtp with the following command: <br></p>

<blockquote>
  <p>ffmpeg -re -i HLSstream -c copy -f mpegts - 2>/dev/null | vlc -
  --ttl=255 -I dummy --sout '#rtp{access=rtp,mux=ts,dst=IP,port=PORT}' :sout-all :sout-keep</p>
</blockquote>

CC BY-SA 3.0
2017-08-10T06:53:31.770Z
2017-08-10T06:53:31.770Z
Ivan Kolesnikov
<p>I want to transmit HLS stream to RTP multicast via FFmpeg and use the following command: </p>

<blockquote>
  <p>ffmpeg -re -i HLSstream -c copy -f rtp_mpegts rtp://ip:port</p>
</blockquote>

<p>But the output source сrumbles sometimes (I can't understand periodicity of it). I playing it via VLC and it shows the following errors: <br></p>

<blockquote>
  <p>[00007fe17800b508] ts demux error: libdvbpsi error (PSI decoder): TS
  discontinuity (received 7, expected 2) for PID 0</p>
  
  <p>[00007fe17800b508] ts demux error: libdvbpsi error (PSI decoder): TS
  discontinuity (received 7, expected 2) for PID 4096</p>
  
  <p>[00007fe17800b508] ts demux error: libdvbpsi error (PSI decoder): TS
  discontinuity (received 8, expected 7) for PID 17</p>
  
  <p>[00007fe17800b508] ts demux error: libdvbpsi error (PSI decoder): TS
  discontinuity (received 2, expected 14) for PID 0</p>
  
  <p>[00007fe17800b508] ts demux error: libdvbpsi error (PSI decoder): TS
  discontinuity (received 2, expected 14) for PID 4096</p>
</blockquote>

<p>It works well when I copy the HLS stream to local file and play it. <br>
Is the way to fix it? Or please advice other tool to transmit HLS to UDP.</p>

CC BY-SA 3.0
2017-08-09T20:18:15.190Z
RTP/UDP is a lossy protocol. You should expect lost packets.
SlimSCSI
CC BY-SA 3.0
2017-08-10T06:44:55.437Z
ok. thanks! I routed output from ffmpeg to vlc2 with the following command:
ffmpeg -re -i HLSstream -c copy -f mpegts - 2>/dev/null | vlc - --ttl=255 -I dummy --sout '#rtp{access=rtp,mux=ts,dst=IP,port=PORT}' :sout-all :sout-keep
And it works without errors. In previous variant I saw crumbles each 5-40 seconds.
Ivan Kolesnikov
<ffmpeg><hls>
HLS to RTP multicast FFmpeg
Ivan Kolesnikov
# HLS to RTP multicast FFmpeg

(Asked by: username_0 on 2017-08-09)

I want to transmit HLS stream to RTP multicast via FFmpeg and use the following command:

> ffmpeg -re -i HLSstream -c copy -f rtp\_mpegts rtp://ip:port

But the output source сrumbles sometimes (I can't understand periodicity of it). I playing it via VLC and it shows the following errors:

> [00007fe17800b508] ts demux error: libdvbpsi error (PSI decoder): TS
> discontinuity (received 7, expected 2) for PID 0
>
> [00007fe17800b508] ts demux error: libdvbpsi error (PSI decoder): TS
> discontinuity (received 7, expected 2) for PID 4096
>
> [00007fe17800b508] ts demux error: libdvbpsi error (PSI decoder): TS
> discontinuity (received 8, expected 7) for PID 17
>
> [00007fe17800b508] ts demux error: libdvbpsi error (PSI decoder): TS
> discontinuity (received 2, expected 14) for PID 0
>
> [00007fe17800b508] ts demux error: libdvbpsi error (PSI decoder): TS
> discontinuity (received 2, expected 14) for PID 4096

It works well when I copy the HLS stream to local file and play it.   
Is the way to fix it? Or please advice other tool to transmit HLS to UDP.

**Tags:** ffmpeg, hls

> **Comments:**
> **username_1**: RTP/UDP is a lossy protocol. You should expect lost packets.  
> **username_0**: ok. thanks! I routed output from ffmpeg to vlc2 with the following command: ffmpeg -re -i HLSstream -c copy -f mpegts - 2>/dev/null | vlc - --ttl=255 -I dummy --sout '#rtp{access=rtp,mux=ts,dst=IP,port=PORT}' :sout-all :sout-keep And it works without errors. In previous variant I saw crumbles each 5-40 seconds.  

---

## 1 answers

### Answer by username_0 on 2017-08-10. Score: 0

It's not the best variant, but in my case it helped. I getting data with ffmpeg then routing output to vlc2 via pipe and transmitting it to rtp with the following command:

> ffmpeg -re -i HLSstream -c copy -f mpegts - 2>/dev/null | vlc -
> --ttl=255 -I dummy --sout '#rtp{access=rtp,mux=ts,dst=IP,port=PORT}' :sout-all :sout-keep


---

