Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stream video in a loop via RTP using ffmpeg?

Given a file input.mp4, how can I use ffmpeg to stream it in a loop to some rtp://xxx:port?

I was able to do something similar for procedurally generated audio based on the ffmpeg streaming guides, but I was unable to find a video example:

ffmpeg -re -f lavfi -i aevalsrc="sin(400*2*PI*t)" -ar 44100 -f mulaw -f rtp rtp://xxx:port
like image 276
Sagi Mann Avatar asked Oct 14 '25 18:10

Sagi Mann


1 Answers

You could try this:

ffmpeg -re -fflags +genpts -stream_loop -1 -i input.mp4 -f rtp rtp://xxx:port
like image 192
VC.One Avatar answered Oct 17 '25 09:10

VC.One