Viewing UDP stream from AWS EC2 on user's PC


Hello! Iam trying to build the following system. I have IP camera which sends RTSP stream to AWS server over internal VPN network. I want to forward this stream to the AWS EC2 network and view forwarded stream on the user's PC. I have stream forwarding working but the problem is that redirected UDP stream is accessible only on the AWS and I cannot view it on the user's PC. The port which is used for redirected UDP stream is opened in the AWS security rules. Can anyone say why the stream might be not accessible anywhere except AWS machine?

For stream forwarding I am using ffmpeg utility, the command for redirection is "ffmpeg -i rtsp://<IP camera stream address in VPN net> -c copy -bufsize 4096k -f mpegts udp://<AWS EC2 server IP>:<port>/stream


asked a month ago155 views
1 Answer

To troubleshoot the issue of the redirected UDP stream not being accessible outside of the AWS environment, you have to consider doing this check :-

Firewall Configuration: Ensure that the security groups associated with the EC2 instance allow incoming UDP traffic on the specified port from external sources, such as the user's PC. Double-check both the inbound and outbound rules of the security group.

Network Address Translation (NAT): If the EC2 instance is located in a private subnet, verify that there is a properly configured NAT gateway or NAT instance in the VPC to allow outbound internet access for the UDP stream. Without NAT, the response packets from the EC2 instance may not be able to reach the user's PC.

Public IP Address: Confirm that the EC2 instance has a public IP address assigned to it, or that there is an Elastic IP (EIP) associated with it. A public IP address is necessary for communication with external devices outside of the AWS environment.

Routing: Check the routing tables in the VPC to ensure that traffic destined for the user's PC is routed correctly. Make sure there are no route table entries or network ACLs blocking the traffic.

Use network diagnostic tools such as tcpdump or Wireshark to inspect the network traffic between the EC2 instance and the user's PC. This can help identify any issues with packet transmission or routing.

Endpoint Configuration: If you are using a VPC endpoint for the RTSP stream, verify that it is configured correctly and that it allows traffic from external sources.

Protocol Restrictions: Confirm that there are no protocol restrictions or limitations on UDP traffic imposed by the ISP or any intermediate network devices between the EC2 instance and the user's PC.

profile picture
answered a month ago
  • Thanks for the answer! I have a question regarding the NAT configuration. Do I need to set it up if the server has public IP address?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions