Skip to content

Commit

Permalink
#2. 메인메뉴 글자 위치 수정, Ctrl+C키로 프레임 추출 중단 기능 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
VDoring authored Jul 21, 2021
1 parent ab32c2c commit fc26ebe
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions python ver/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,26 @@

vid_name = ''

# by VDoring. 2021-07-21
# 타이틀화면을 표시합니다.
def mainTitle():
os.system('mode con cols=45 lines=10')
os.system('title VFrame Image v0.1')
print('Video Frame Image Converter')
print('by VDoring\n\n')
os.system('title VFrame Image v0.1.1')
print('\n < Video Frame Image Converter >')
print(' ver0.1.1 - by VDoring\n\n')
os.system('pause')


# by VDoring. 2021-07-20
# 추출할 동영상 파일을 선택합니다.
def fileNameSet():
global vid_name

os.system('cls')
print('Input video file name.')
vid_name = input('> ')


# by VDoring. 2021-07-20
# 동영상 프레임을 추출하여 사진으로 저장합니다.
def convertFrameImage():
global vid_name

Expand All @@ -38,15 +42,17 @@ def convertFrameImage():
ret, image = capture.read()
cv2.imwrite("outputImage/%d.jpg" %int(capture.get(cv2.CAP_PROP_POS_FRAMES)), image)
print('Running.. [' + str(int(capture.get(cv2.CAP_PROP_POS_FRAMES))) + '/' + str(int(video_frame_all)) + ']')
print('Done!')

except KeyboardInterrupt:
print('Stopped!')
os.system('pause')

except:
print('ERR-Done!')
print('Done!')
os.system('pause')


# 메인코드
# 메인코드 #
while True:
mainTitle()
fileNameSet()
Expand Down

0 comments on commit fc26ebe

Please sign in to comment.