使用python模块ffpyplayer,如何查看帧或让img对象在屏幕上显示或显示视频图像/帧?,在我跟随的教程中,它看起来很简单,它读取帧并播放oudio,但(不显示)任何视频图像或帧到屏幕,只有添加(print img,t)才会将帧信息打印到屏幕上,而不会在屏幕上显示视频图像。在
我正在跟随来自:https://pypi.python.org/pypi/ffpyplayer,这里:http://matham.github.io/ffpyplayer/player.html的教程,并搜索了google,但是唯一相关的结果指向了相同的信息,我对编程和python有点陌生,所以可能我遗漏了一些看起来很简单但我自己无法理解的东西。在
我使用的是:Windows7 64位,python 2.7.11 32位。在
如有任何帮助,我们将不胜感激。在from ffpyplayer.player import MediaPlayer
vid = 'test_video.flv'
player = MediaPlayer(vid)
val = ''
while val != 'eof':
frame, val = player.get_frame()
if val != 'eof' and frame is not None:
img, t = frame
print img, t #This prints the image object
# display img #This does nothing!