[FFmpeg-user] Streaming video over UDP, connecting at any time

Ad Go adrngrl at gmail.com
Tue Jun 15 15:49:26 EEST 2021


Hi,

I'm trying to receive a video from a tcp stream and to re-stream it
over udp on localhost. This is what I have now:

(1) Receiving and duplicating stream on udp
ffmpeg -i tcp://192.168.186.130:6060?listen -f avi -c:v ffvhuff -an
udp://127.0.0.1:1234

(2) Receiving udp stream and saving to video file
ffmpeg -i udp://127.0.0.1:1234 -c:v copy -an output.avi

Both commands are executed on the same machine. I would like to run
the second command at any time, if only the udp stream is present.
However, when I'm trying to do it this way, after executing (2), I get
an error:
"udp://127.0.0.1:1234: Invalid data found when processing input"

It only works fine when I run (2) first, then (1) and then start tcp
transmission.
Is there any way to be able to start grabbing the local (udp) stream
at any moment (including disconnecting and reconnecting several times
during the broadcast)?

Thanks in advance for your help,
Adrian


More information about the ffmpeg-user mailing list