视频解码与显示问题

我的预期功能是:就是decode解码然后在显示器上循环播放视频。

但是我一模一样的程序在x3上跑的了,能正常显示视频,但是在x5上就是一直报错 不明白是哪里有问题。

报错如下

贴一下完整代码:

import sys, os, time

import numpy as np
import cv2
from hobot_vio import libsrcampy


def test_decode_bind_display():
 #decode start
 dec = libsrcampy.Decoder()
 dec1 = libsrcampy.Decoder()
 dec.decode("/root/face/wmzn.h264", 0, 1,  1920,1080)
 # print ("Decoder return:%d frame count: %d" %(ret[0], ret[1]))
 dec1.decode("/root/face/wmzn_b.h264", 5, 1,  1920,1080)
 # #display start
 disp = libsrcampy.Display()
 ret = disp.display(0,  1920,1080, 0, 1)
 print ("Display display 0 return:%d" % ret)

 ret = libsrcampy.bind(dec, disp)
 # print("libsrcampy bind return:%d" % ret)
 # time.sleep(21)


 num = 1
 while True:
 time.sleep(7)
 # print(num)
 # print('togg')
 if num: 
 dec1.close()
 ret = dec1.decode("/root/face/wmzn.h264", 4, 1,  1920,1080)
 ret = libsrcampy.unbind(dec, disp)
 ret = libsrcampy.bind(dec1, disp)
 num = 0
 else:
 dec.close()
 ret = dec.decode("/root/face/wmzn_b.h264", 2, 1,  1920,1080)
 ret = libsrcampy.unbind(dec1, disp)
 ret = libsrcampy.bind(dec, disp)
 num = 1








    ret = libsrcampy.unbind(dec, disp)
 print("libsrcampy unbind return:%d" % ret)
    disp.close()

    dec.close()
 print("test_decode_bind_display done!!!")

# test_decode()
while True:
 test_decode_bind_display()
 

你好,X5如果需要使用HDMI硬件直出,需要执行 sudo systemctl stop lightdm 把图形化界面关闭。

我也遇到了这个问题,请问解决了吗,急!!!

还是报错 是什么问题呢