[FFmpeg-user] Autolaunch FFMPEG when network traffic detected
ybarbeaux+ffmpeg at gmail.com
Mon Jul 23 18:34:19 EEST 2018
Yes, I should have started with the setup description:
I have several (i)Phones that send mpeg-ts/udp video stream over LTE to a
debian 9.0 computer with a Blackmagic Decklink Quad with up to 8 SDI output.
I link each phone to a SDI Output.
from the command line, I manually launch an instance of ffmpeg for each
# phone 1 sending on port 3001/UDP, output SDI 1
ffmpeg -i udp://localhost:3001 -pix_fmt uyvy422 -s 720x576 -r 25000/1000
-c:a pcm_s16le -ar 48000 -ac 2 -f decklink "DeckLink Quad (1)"
# phone 2 sending on port 3002/UDP, output SDI 2
ffmpeg -i udp://localhost:3002 -pix_fmt uyvy422 -s 720x576 -r 25000/1000
-c:a pcm_s16le -ar 48000 -ac 2 -f decklink "DeckLink Quad (2)"
... and so on, for up to 8 phones
I wish I could monitor each of those ports and launch the corresponding
command automatically as soon as the incoming stream is detected (and stop
when the stream ends)
One ugly solution would be to launch all ffmpeg at boot and let them run but
if one stream is interrupted (a phone stops its stream for a while), when it
resumes, ffmpeg has audio problems (no sound at all), so I have to restart
ffmpeg manually to address this issue. I should investigate this problem
I hope it is more clear now. I have managed to write iptables rules that log
only some packets per minute and I could use that log in a script to start
and stop ffmpeg accordingly but I still hope there is a better solution...
Sent from: http://www.ffmpeg-archive.org/
More information about the ffmpeg-user