I'm writing a script to stream webcam video / audio to http or rtmp using ffmpeg. I managed to get the capture devices right and have them output to mp4 file, streaming to UDP also seems to work but I want to go with TCP. For some reason ffmpeg always complains about the connection and is unable to access the address.
Code:
ffmpeg -f video4linux2 -i /dev/video0 -f alsa -i hw:2 -f mpegts http://1.2.3.4:5678
This instantly gives the error "connection refused". I understand I need to add the parameter "-listen 1" for http to work, I did so but now the error then becomes "cannot assign requested address". Some articles suggested using ffserver but that command doesn't exist, I take it the normal ffmpeg command acts as that now? Firewall settings and port forwarding in the router are configured and shouldn't be the problem.