aliceblue11 commited on
Commit
85e550a
·
verified ·
1 Parent(s): 2a485a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -71,15 +71,25 @@ def process_video(video, start_time, end_time, resolution, fps, speed, repeat):
71
  # 동영상 정보 추출
72
  duration = get_video_info(video_path)
73
 
 
 
 
 
74
  # 썸네일 생성
75
  start_thumb, end_thumb = generate_thumbnails(video_path, start_time, end_time)
76
 
 
 
 
 
77
  # GIF 생성
78
  gif_path = create_gif(video_path, start_time, end_time, resolution, fps, speed, repeat)
79
 
80
  if gif_path:
 
81
  return gif_path, gif_path
82
  else:
 
83
  return None, None
84
 
85
  with gr.Blocks() as demo:
@@ -105,7 +115,7 @@ with gr.Blocks() as demo:
105
 
106
  with gr.Row():
107
  speed = gr.Slider(label="재생 속도 조절", minimum=0.5, maximum=3.0, step=0.1, value=1.0)
108
- repeat = gr.Slider(label="GIF 반복 횟수", minimum=-1, maximum=10, step=1, value=-1)
109
 
110
  generate_button = gr.Button("GIF 생성")
111
 
 
71
  # 동영상 정보 추출
72
  duration = get_video_info(video_path)
73
 
74
+ if duration is None:
75
+ logging.error("동영상 정보를 가져올 수 없습니다.")
76
+ return None, None
77
+
78
  # 썸네일 생성
79
  start_thumb, end_thumb = generate_thumbnails(video_path, start_time, end_time)
80
 
81
+ if not start_thumb or not end_thumb:
82
+ logging.error("썸네일 생성에 실패했습니다.")
83
+ return None, None
84
+
85
  # GIF 생성
86
  gif_path = create_gif(video_path, start_time, end_time, resolution, fps, speed, repeat)
87
 
88
  if gif_path:
89
+ logging.info(f"생성된 GIF 경로: {gif_path}")
90
  return gif_path, gif_path
91
  else:
92
+ logging.error("GIF 생성에 실패했습니다.")
93
  return None, None
94
 
95
  with gr.Blocks() as demo:
 
115
 
116
  with gr.Row():
117
  speed = gr.Slider(label="재생 속도 조절", minimum=0.5, maximum=3.0, step=0.1, value=1.0)
118
+ repeat = gr.Slider(label="GIF 반복 횟수 (-1은 무한 반복)", minimum=-1, maximum=10, step=1, value=-1)
119
 
120
  generate_button = gr.Button("GIF 생성")
121