使用方法 :
python player.py [LINK]
代码 :
#!/usr/bin/env python
# coding:utf-8
import cv2
import sys
def play(url):
cap = cv2.VideoCapture(url)
while cap.isOpened():
ret,frame = cap.read()
cv2.imshow("frame",frame)
cv2.waitKey(1)
def main():
if len(sys.argv) != 2:
print "Usage : "
print " python tplayer.py"
print "Author : "
print " WangYihang <wangyihanger@gmail.com>"
exit(1)
url = sys.argv[1]
play(url)
if __name__ == '__main__':
main()
截图展示 :
资源 :
大熊兔(点播):rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov
CCTV1高清:http://ivi.bupt.edu.cn/hls/cctv1hd.m3u8
CCTV3高清:http://ivi.bupt.edu.cn/hls/cctv3hd.m3u8
CCTV5高清:http://ivi.bupt.edu.cn/hls/cctv5hd.m3u8
CCTV5+高清:http://ivi.bupt.edu.cn/hls/cctv5phd.m3u8
CCTV6高清:http://ivi.bupt.edu.cn/hls/cctv6hd.m3u8