Skip to content

Instantly share code, notes, and snippets.

@MerleLiuKun
Created October 31, 2018 02:12
Show Gist options
  • Save MerleLiuKun/0ce999e773234d0304f3bf3ca2bb2a45 to your computer and use it in GitHub Desktop.
Save MerleLiuKun/0ce999e773234d0304f3bf3ca2bb2a45 to your computer and use it in GitHub Desktop.
Get Online video's frame pic
import cv2
video_url = 'https://scontent.xx.fbcdn.net/v/t50.2886-16/39483744_2088298591194407_5257741205319450624_n.mp4?_nc_cat=109&oh=807b4ef98367893cacb969323f47048b&oe=5C4D7231'
vidcap = cv2.VideoCapture(video_url)
vidcap.set(cv2.CAP_PROP_POS_MSEC, 1000)
success, image = vidcap.read()
if success:
cv2.imwrite('frame.jpg', image)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment