Spaces:
Sleeping
Sleeping
Update app/routers/video.py
Browse files- app/routers/video.py +3 -2
app/routers/video.py
CHANGED
|
@@ -103,10 +103,11 @@ async def process_video_and_return_url(video_file: UploadFile):
|
|
| 103 |
video_path = os.path.join(upload_dir, video_file.filename)
|
| 104 |
output_dir = "output_frames"
|
| 105 |
os.makedirs(output_dir, exist_ok=True)
|
| 106 |
-
|
| 107 |
if not os.access(output_dir, os.W_OK):
|
| 108 |
raise PermissionError(f"Cannot write to directory: {output_dir}")
|
| 109 |
-
output_image_path =
|
|
|
|
|
|
|
| 110 |
|
| 111 |
# Save the uploaded video file
|
| 112 |
try:
|
|
|
|
| 103 |
video_path = os.path.join(upload_dir, video_file.filename)
|
| 104 |
output_dir = "output_frames"
|
| 105 |
os.makedirs(output_dir, exist_ok=True)
|
|
|
|
| 106 |
if not os.access(output_dir, os.W_OK):
|
| 107 |
raise PermissionError(f"Cannot write to directory: {output_dir}")
|
| 108 |
+
output_image_path = f"./{output_dir}/{os.path.splitext(video_file.filename)[0]}_first_frame.png"
|
| 109 |
+
print(output_image_path)
|
| 110 |
+
# output_image_path = (os.path.join(output_dir, f"{os.path.splitext(video_file.filename)[0]}_first_frame.png")).replace("\\", "/")
|
| 111 |
|
| 112 |
# Save the uploaded video file
|
| 113 |
try:
|