Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

CS 2520 Project 2

Video streaming

In this project, the goal is to explore how video streaming works at a very basic level. A video stream is essentially a sequence of packets that encapsulate the video data that the receiver receives, parses, and plays in real-time. The usual issues with wide area networks also come into play – such as packet losses and unexpected delays. We will explore how these factors affect the video streaming performance and some ways to make the video streaming experience better.

Exploring video stream:

We have provided you with two Python files. "video-src.py" just reads the video file and sends it as UDP packets to the video client. "video-dst.py" receives these packets and displays them on the screen. The video source file has two variables "PACKET_DROP_PERCENTAGE" and "PACKET_DELAY_SEC". According to these variables, the video source will add a delay or drop packets randomly. The packets are being sent over localhost. These two Python files have been provided to you to help you start exploring. You may or may not use these files further – you may write your code if you prefer.

First, using the provided files, try adjusting the packet drop percentage and/or the delay and see how that affects the video on the destination. Try a few different values, such as a very small delay and/or drop percentage, and then increase that to a very high value. Report what you see in your report.

Improving video streaming experience:

The main part of the project is to try to make the video streaming experience better. You will try to make the video on the destination as "smooth" as possible. There are various techniques that you can employ such as:

Some sort of buffering on the destination. For each packet you receive, you store it and play it after a fixed interval. This may improve the experience in some cases such as if a packet is delayed then you may still receive it in time so that the video remains smooth. Note that when we say that we are buffering a video, we do not mean that we are downloading the video in its entirety and then playing it as that would not be a good experience for a user to wait for a video to finish downloading each time they want to watch it.

Ensuring packet delivery. If a packet gets dropped, then it may be possible for the server to detect this and send it again. This can be done through ACK packets that the client sends for each packet of groups of packets. However, it is important to notice here that sending an ACK message and then receiving the same packet may take some time and you are simultaneously showing the video on your client. So, this may work but you will have to make sure you know when to skip a video packet if you need to keep the video stream smooth.

Adjusting video quality. This is commonly done by different streaming services such as YouTube. The server holds different quality versions of the video file and if the server gets to know that the client is not getting packets in time, then it may start to send packets from a lower-quality version of the video file. For this to work, you would need to write a simple protocol between the server and the client. This protocol would essentially have some sort of status update message being sent by the client to the server. If the client finds out that it is missing packets, then it will send a message to the server to let it know that this is happening, and the server will act accordingly.

Project goals and submission:

The main goal is to explore video streaming and how to work around different network limitations to ensure a good experience. You will explore the ideas mentioned above and write about your experiences in the report. You will mention in your report:

· How does changing the delay and drop percentage affect the video's "smoothness"?

· Does buffering at the client help improve the experience? What are the drawbacks? How did you experiment with this approach (describe what code you wrote, how did you experiment (i.e. with what delay and drop percentage values, etc.)?

· Can and does resending dropped video packets help? How did to attempt to explore this? What are the drawbacks?

· Can and does changing the video quality help make the video streaming smoother? How did you explore this? What are the drawbacks?

You will write about this in your report. You may also explore some other ideas and mention those in the report as well. Also, upload whatever code you wrote for this project.