Play video stored on the web python [closed]

1

Imagine that I have video in a directory of a website and not in a tag, example: www.site.com/video.mp4, how can I play this video using python + tkinter?

    
asked by anonymous 25.07.2017 / 15:56

1 answer

0

In python, you can play videos with OpenCV . I've never used it to play videos stored remotely, but if you can, just download the video (inside the app itself) to the application location and run it, below an example of documentation :

# Playing Video from file 

import numpy as np
import cv2

cap = cv2.VideoCapture('vtest.avi')

while(cap.isOpened()):
    ret, frame = cap.read()

    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

    cv2.imshow('frame',gray)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

cap.release()
cv2.destroyAllWindows()

If the video is in a service on the network, we have livestreamer which is a lib (CLI) that allows the capture of streams of services like youtube, dailymotion, etc., and you can run in a VLC type player or developed by you.

    
25.07.2017 / 18:30