mpromonet / v4l2rtspserver

RTSP Server for V4L2 device capture supporting HEVC/H264/JPEG/VP8/VP9
The Unlicense
1.82k stars 423 forks source link

ffmpeg rtsp_transport tcp not working when running on same machine / remote causes local to work #303

Open t3therdev opened 1 year ago

t3therdev commented 1 year ago

Describe the bug

Openwrt 22.03.3, v4l2rtspserver 2.3

Running v4l2rtspserver on an embedded devices. streaming, running no errors.

When running ffmpeg from the local device/console rtsp over tcp does not work properly. ffmpeg connects but never recieves any frames. However, when running from any other pc on the local network it does work. Local rtsp over udp works fine with ffmpeg. **Also, if a remote ffmpeg connects, the local one will start to connect as well.

Working: -- Running LOCAL and remote using the IP ffmpeg -i rtsp://localhost:554/stream -acodec copy -vcodec copy /tmp/lala.mp4 ffmpeg -i rtsp://192.168.1.200:554/stream -acodec copy -vcodec copy /tmp/lala.mp4

Not Working LOCAL , but does work remote. ffmpeg -rtsp_transport tcp -i rtsp://localhost:554/stream -acodec copy -vcodec copy /tmp/lala.mp4 ffmpeg -rtsp_transport tcp -i rtsp://192.168.1.200:554/stream -acodec copy -vcodec copy /tmp/lala.mp4

we also tried the -I setting to force the interface. all firewall rules are disabled and allowed (hence why it works over the network)

To Reproduce Run v4l2rtspserver with usb camera h264 Try to connect with ffmpeg using rtsp_transport tcp Does not connect remote tcp it works.

Expected behavior Expected that it will work on the same machine using TCP.

mpromonet commented 1 year ago

Hi,

You should get more information enabling ffmpeg logs, or using network tool like tcpdump or tshark.

Best Regards, Michel.