Camera Streaming via Ethernet from Petalinux on Zedboard to a Client PC

The main goal of this project is to stream live images from a camera connected to a Zedboard running Petalinux, via TCP sockets to a client who runs a python script in order to print the image streaming. The server who runs on Petalinux is written in C and is used to control the camera by taking snapshots sending them to the client. The hardware code is written in both Verilog and VHDL.


Video Demonstration

Let’s see the equipment we used for the purposes of this project:

  1. Zedboard development kit
  2. OV7670 camera module
  3. Petalinux 2015.2
  4. Vivado and SDK 2015.2 (following this compatibility guide)
  5. Ethernet Cable


This is our project Block Diagram


You can find the instructions on how to establish a connection via Ethernet between your PC and a Zedboard running Petalinux on chapter H and I of this post by embeddedcentric.

Let’s now begin explaining the hardware part of this project which code and Petalinux boot images are available here.

The Hardware


First of all we modify the processing system according to the bring up guide for petalinux.

Now to the cameraIp module. We use some of the code of this project by Mike Field and with some additions we managed to add the functionality for the camera to take snapshots. We basically removed the vga part of the code, created the snapshot module and also we modified the top module according to our current specifications. All this modules were packaged in an Axi-4-Lite Ip to work with the processing system. The control signals and the captured image were used in the Axi bus and the camera function signals were made external so as to be connected to the pmod pins of the Zedboard.

The logic part of this Ip works like this:

  1. The control signal of the arm processor arrives
  2. The camera freezes and a snapshot is stored in a Bram of the Ip with the dimensions of 640×480 in 8-bit format.
  3. At every access of the data from the processor, the hardware converts the pixels format to 24-bit(the client uses a 24-bit format to print out the images) and propagates 4 pixels to the output registers.
  4. After a successful image reading a control signal from the processor arrives and the camera unfreezes.

Now the hardware part is completed and we used these steps to create the hardware platform to run petalinux on it.

The Petalinux Server Software

We created the server application to work this way:

  1. The server opens a TCP socket and waits for a connection from the client
  2. When connected it waits for the client request signal to start streaming
  3. When the request signal arrives, the server freezes the image through a control signal sent to the specific address of the cameraIp interface
  4. The server reads the image from the cameraIp interface and stores it in a array
  5. When finished, the image array is sent through the socket port to the client
  6. Unfreezes the camera and waits for another request to run again from step 3

The Client Software

Finally we created a simple application in python which receives the image from the TCP socket port and renders it in a graphical window. We use the pygame library of python to create the image window and update it with the new images from the socket port.


4 thoughts on “Camera Streaming via Ethernet from Petalinux on Zedboard to a Client PC

  1. dj9607

    Hi, thanks for the great post. I could not locate the constraint file (XDC) on your github, will it be possible for you to upload it, or mail it to me.


    1. Hi! We are glad that you liked the post! The .xdc file is located at the in the project3/project_2.srcs/constrs_1/imports/camera_project directory.


  2. Falcon

    Interesting project! I came across this while trying to do something similar. I have a few questions:
    1. Is there any reasoning behind choosing the values of the slave registers from the frame pixel?
    2. When opening the project with Vivado, I get that the camera IP is locked and the IP definition is missing. Is it possible to upload it to github?


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s