컴퓨터/Python
python 동영상 mp4 화면비율 변경 /youtube 영상 윈도우창에 출력
풍경소리^^
2023. 7. 13. 15:22
https://scribblinganything.tistory.com/491
[Python] OpenCV 동영상 파일 재생하기 (화면 사이즈 변경)
목차 OpenCV 동영상 파일 재생하기 앞서 포스트에서 비디오(Video) 파일(mp4)의 영상 정보를 가져오는 방법에 대해 알아보 았습니다. 이번 포스트는 영상 파일의 사이즈 정보를 가져와서 크기를 변경
scribblinganything.tistory.com
import cv2
Vid = cv2.VideoCapture('rain.mp4')
if Vid.isOpened():
fps = Vid.get(cv2.CAP_PROP_FPS)
f_count = Vid.get(cv2.CAP_PROP_FRAME_COUNT)
f_width = Vid.get(cv2.CAP_PROP_FRAME_WIDTH)
f_height = Vid.get(cv2.CAP_PROP_FRAME_HEIGHT)
print('Frames per second : ', fps,'FPS')
print('Frame count : ', f_count)
print('Frame width : ', f_width)
print('Frame height : ', f_height)
while Vid.isOpened():
ret, frame = Vid.read()
if ret:
re_frame = cv2.resize(frame, (round(f_width/4), round(f_height/1)))
cv2.imshow('Car_Video',re_frame)
key = cv2.waitKey(10)
if key == ord('q'):
break
else:
break
Vid.release()
cv2.destroyAllWindows()
https://my-coding-footprints.tistory.com/36
[OpenCV] 유튜브영상 윈도우창에 출력하기
https://ytdl-org.github.io/youtube-dl/download.html youtube-dl: Download Page Remember youtube-dl requires Python version 2.6, 2.7, or 3.2+ to work except for Windows exe. Windows exe requires Microsoft Visual C++ 2010 Redistributable Package (x86) and doe
my-coding-footprints.tistory.com