在PYNQ-Z1上跑H.264 video encoder v2.0 demo



  • Re: 基于PYNQ的H.264演示Demo

    在PYNQ-Z1上跑H.264 video encoder v2.0 demo

    你好!

    我们根据“1629349156403-h264-encoder-rtl-v2.0仿真及fpga教程_v2.ppt”的流程在PYNQ-Z1上跑H.264 encoder v2.0的demo, 有以下问题:

    1. PYNQ v2.0.img在PYNQ-Z1板上跑不起来(LD4,5没有闪动,LD0-3没有亮), LD12-13是亮的,好像是boot的时候卡死在usb端口了。

    2. 用 PYNQ v3.0.1.img可以启动和连通(浏览器可以打开jupyter notebook), 但是跑“使用VLC接收HDMI视频流_1080p.ipynb”时跑不了,要在notepad++里打开原来的.ipynb档然后另存另外一个名字(比如use VLC to accept HDMI stream 1080p.ipynb)才能在jupyter notebook里打开。

    3. 跑到第3步后出了以下错误信息:


    RuntimeError Traceback (most recent call last)
    Input In [3], in <cell line: 4>()
    1 from pynq.overlays.h264 import H264Overlay
    2 from pynq.lib.video import *
    ----> 4 base = H264Overlay("h264.bit")
    5 hdmi_in = base.video.hdmi_in

    File /usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/overlays/h264/h264.py:61, in H264Overlay.init(self, bitfile, **kwargs)
    60 def init(self, bitfile, **kwargs):
    ---> 61 super().init(bitfile, **kwargs)
    62 if self.is_loaded():
    63 print("load ready")

    File /usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/overlay.py:319, in Overlay.init(self, bitfile_name, dtbo, download, ignore_version, device, gen_cache)
    315 super().init(bitfile_name, dtbo, partial=False, device=device)
    317 self._register_drivers()
    --> 319 self.device.set_bitfile_name(self.bitfile_name)
    320 self.parser = self.device.parser
    322 self.ip_dict = (
    323 self.gpio_dict
    324 ) = (
    325 self.interrupt_controllers
    326 ) = self.interrupt_pins = self.hierarchy_dict = dict()

    File /usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/pl_server/device.py:118, in Device.set_bitfile_name(self, bitfile_name)
    116 def set_bitfile_name(self, bitfile_name: str) -> None:
    117 self.bitfile_name = bitfile_name
    --> 118 self.parser = self.get_bitfile_metadata(self.bitfile_name)
    119 self.mem_dict = self.parser.mem_dict
    120 self.ip_dict = self.parser.ip_dict

    File /usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/pl_server/embedded_device.py:692, in EmbeddedDevice.get_bitfile_metadata(self, bitfile_name, partial)
    690 parser = _get_bitstream_handler(bitfile_name).get_parser(partial=partial)
    691 if parser is None:
    --> 692 raise RuntimeError("Unable to find metadata for bitstream")
    693 return parser

    RuntimeError: Unable to find metadata for bitstream

    1. 跑到第4步后,返回以下信息:

    NameError Traceback (most recent call last)
    Input In [5], in <cell line: 2>()
    1 from pynq import MMIO
    ----> 2 rgb2yuv = MMIO(base.ip_dict['h264/rgb2yuv_with_axi_0']['phys_addr'], 0x10000)
    3 h264 = MMIO(base.ip_dict['h264/h264enc_with_axi_0']['phys_addr'], 0x10000)
    5 from h264py.h264 import H264

    NameError: name 'base' is not defined

    1. 跑到第6步(Repeat from here):

    ConnectionRefusedError Traceback (most recent call last)
    <ipython-input-7-128c56b52014> in <module>()
    27
    28 h264_size = h264.read(0x1c)
    ---> 29 h264_send.send_frame(result[:h264_size])
    30
    31 cma_send.freebuffer()

    /home/xilinx/jupyter_notebooks/h264py/h264.py in send_frame(self, raw_h264)
    77 send_buf = np.concatenate((padding, raw_h264, np.zeros(100, dtype=np.uint8)))
    78 debug("SLICE:", send_buf, MAX_RTP_PKT_LENGTH + 14)
    ---> 79 self.sock.send(send_buf[:MAX_RTP_PKT_LENGTH + 14])
    80
    81 # Middle block

    ConnectionRefusedError: [Errno 111] Connection refused

    1. 请问有碰到过类似的问题吗? 设计包里的.ipynb档对PYNQ-Z1的img有没有版本要求?(一定要匹配v2.0的img吗?)

    2. 另外我们用VLC打开接收端PC的w.sdp后,它没有视频显示,只有进度条在来回跑,应该是接收不到视频流?

    能否提供一个基于v3.0.1的demo包?或者以上的问题有解决方法吗?

    感谢!