python 看高清 CCTV 直播


使用方法 :

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 "
        exit(1)
    url = sys.argv[1]
    play(url)


if __name__ == '__main__':
    main()

截图展示 :

Screenshot from 2017-04-25 21-26-59.png

资源 :

大熊兔(点播):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

你可能感兴趣的:(python 看高清 CCTV 直播)