# Custom Video Pipeline Overlay for ZCU104 Issue

**URL:** <https://discuss.pynq.io/t/custom-video-pipeline-overlay-for-zcu104-issue/270>\
**Category:** Support\
**Created:** [July 3, 2019, 1:14am UTC](https://discuss.pynq.io/t/custom-video-pipeline-overlay-for-zcu104-issue/270 "2019-07-03T01:14:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dcc3](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@dcc3](https://discuss.pynq.io/u/dcc3)\
**Post date:** [July 3, 2019, 1:14am UTC](https://discuss.pynq.io/t/custom-video-pipeline-overlay-for-zcu104-issue/270/1 "2019-07-03T01:14:36Z")

</div>

I have built custom HLS video processing cores for the Z1 and was successful in building a custom overlay that worked as expected with the hdmi in and out tie. I took this same core and changed it from 24 bit to 48 bit to target the ZCU104 (changing the referenced board part accordingly). I also placed the core in-between the color\_convert and pixel\_pack cores as I did in the Z1. After rebuilding the bitstream I then added the 3 custom system files to my PYNQ SD card (custom.bit, custom.hwh, custom.tcl). Using the Overlay class my script successfully loads the new overlay but when I run the following code to configure the hdmi I got an errror:

 ![pynq_issue](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/1X/8dfa5011e6353db77317dbaf7d23744f057c7260.jpeg)

Is there something obvious that I’m missing?

---

<div class="post-metadata">

**Author:** ![PeterOgden](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/peterogden/32/55_2.png) [@PeterOgden](https://discuss.pynq.io/u/PeterOgden)\
**Post date:** [July 4, 2019, 1:46pm UTC](https://discuss.pynq.io/t/custom-video-pipeline-overlay-for-zcu104-issue/270/2 "2019-07-04T13:46:36Z")

</div>

The video pipeline for the ZCU104 needs some extra setup that is handled in the `_init_clocks` function in [base.py](https://github.com/Xilinx/PYNQ/blob/master/boards/ZCU104/base/base.py). I would recommend creating your own overlay class and adding the `_init_clocks` and `download` functions into it.

Peter

---

<div class="post-metadata">

**Author:** ![dcc3](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@dcc3](https://discuss.pynq.io/u/dcc3)\
**Post date:** [July 10, 2019, 12:25am UTC](https://discuss.pynq.io/t/custom-video-pipeline-overlay-for-zcu104-issue/270/3 "2019-07-10T00:25:50Z")

</div>

@PeterOgden thanks for the suggestion. Since my last post I have changed three things to ensure I hadn’t made a simple error:

1. I changed my HLS core to perform a simple passthrough function on the video stream so as to be a sanity check.
2. Per the instructions in the Pynq Manual ([https://buildmedia.readthedocs.org/media/pdf/pynq/v2.3/pynq.pdf](https://buildmedia.readthedocs.org/media/pdf/pynq/v2.3/pynq.pdf)) at the top of page 78 “It is usually appropriate to insert the IP after the pixel\_pack block on the HDMI-In block, or before the pixel\_unpack  
block on the HDMI-Out side.” – I converted my HLS core to be 64 bit and placed it after the Pixel Pack in the HDMI-In block.
3. I built this new system and named the .bit, .tcl and .hwh files base and placed them in the sd card directory where the original base files where.

Now, the system allows me to run the jupyter notebook for hdmi\_introduction that does the basic hdmi tie-in. I get a video feed but the output looks like perhaps pixels are being skipped. I get series of vertical BGR lines intermixed with actual footage (see attached image).

I’ve attached my hls code as well and an image of the block diagram in Vivado.

Any suggestions?

 ![passthrough_output](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/1X/f9af6f448035de6f10e3b7f2f2a722a85552d3e0.jpeg)

---

<div class="post-metadata">

**Author:** ![PeterOgden](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/peterogden/32/55_2.png) [@PeterOgden](https://discuss.pynq.io/u/PeterOgden)\
**Post date:** [July 26, 2019, 8:40am UTC](https://discuss.pynq.io/t/custom-video-pipeline-overlay-for-zcu104-issue/270/4 "2019-07-26T08:40:23Z")

</div>

Sorry for the late response - I didn’t get the Discuss notification of the response. You may need to set the pixel pack to 32-bit mode which can be set with `bits_per_pixel` property of the driver.

---

<div class="post-metadata">

**Author:** ![dcc3](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@dcc3](https://discuss.pynq.io/u/dcc3)\
**Post date:** [July 27, 2019, 6:58pm UTC](https://discuss.pynq.io/t/custom-video-pipeline-overlay-for-zcu104-issue/270/5 "2019-07-27T18:58:35Z")

</div>

Peter,

Thank you for the help. Is the bits\_per\_pixel property in Vivado (I configure that for the IP before building the bitstream) or is that a driver file in the PYNQ system base.py?

Thanks!

---

<div class="post-metadata">

**Author:** ![PeterOgden](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/peterogden/32/55_2.png) [@PeterOgden](https://discuss.pynq.io/u/PeterOgden)\
**Post date:** [July 29, 2019, 1:27pm UTC](https://discuss.pynq.io/t/custom-video-pipeline-overlay-for-zcu104-issue/270/6 "2019-07-29T13:27:23Z")

</div>

The bits-per-pixel setting is part of the PYNQ video drivers. The easiest way to set this is to pass a pixel format to `hdmi_in.configure` - `pynq.lib.video.PIXEL_RGBA` is the only one we have out of the box that is 32 bits. This will set the mode up correctly when the incoming resolution is detected.

Peter

---

<div class="post-metadata">

**Author:** ![gsm2019](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/gsm2019/32/2307_2.png) [@gsm2019](https://discuss.pynq.io/u/gsm2019)\
**Post date:** [August 9, 2019, 11:25am UTC](https://discuss.pynq.io/t/custom-video-pipeline-overlay-for-zcu104-issue/270/7 "2019-08-09T11:25:29Z")

</div>

can anyone help as of now i wanna build pynq image for zc706  
my board spec file  
ARCH\_zc706 := arm  
BSP\_zc706 :=/home/sameer-gsm/Downloads/xilinx-zc706-v2018.2-final.bsp  
BITSTREAM\_zc706 := base/base.bit

as of now i m got stuck as shown in pic

 ![pynq706_1](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/1X/b25574e81c73ebd304fd0a95f9c0772afb85a565.png)
