Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| import os | |
| import subprocess | |
| from processor import process_video | |
| def convert_video(input_video): | |
| if input_video is None: | |
| return None | |
| # Process files in /tmp/ to avoid permission issues in Hugging Face | |
| output_path = "/tmp/output_cinema_video.mp4" | |
| # Purani file delete karein agar exist karti ho | |
| if os.path.exists(output_path): | |
| try: | |
| os.remove(output_path) | |
| except: | |
| pass | |
| try: | |
| # Video process karein | |
| process_video(input_video, output_path) | |
| return output_path | |
| except Exception as e: | |
| print(f"Error processing video: {e}") | |
| return None | |
| description = """ | |
| # 🎬 Cinema Recording Simulator (Cam-Rip Effect) | |
| Upload any video to transform it into a "recorded in a cinema hall" version. | |
| """ | |
| # Interface without allow_flagging | |
| interface = gr.Interface( | |
| fn=convert_video, | |
| inputs=gr.Video(label="Upload Video"), | |
| outputs=gr.Video(label="Cinema Version"), | |
| title="Cinema Recording Simulator", | |
| description=description | |
| ) | |
| if __name__ == "__main__": | |
| interface.launch() | |