Spaces:
Runtime error
Runtime error
emrd95
commited on
Commit
•
a4c28ed
1
Parent(s):
b7faa11
fe
Browse files- README.md +8 -8
- app.py +25 -0
- requirements.txt +2 -0
README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo: indigo
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version:
|
8 |
-
app_file: app.py
|
9 |
pinned: false
|
10 |
---
|
11 |
|
12 |
-
|
|
|
1 |
---
|
2 |
+
title: "Video to MP4 Converter"
|
3 |
+
emoji: "🎥"
|
4 |
+
colorFrom: "blue"
|
5 |
+
colorTo: "indigo"
|
6 |
+
sdk: "gradio"
|
7 |
+
sdk_version: "3.0"
|
8 |
+
app_file: "app.py"
|
9 |
pinned: false
|
10 |
---
|
11 |
|
12 |
+
Convert your videos to MP4 format easily with this tool.
|
app.py
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import ffmpeg
|
3 |
+
import os
|
4 |
+
|
5 |
+
def convert_to_mp4(input_video):
|
6 |
+
output_filename = "output.mp4"
|
7 |
+
|
8 |
+
# Convert video to mp4 using FFmpeg
|
9 |
+
stream = ffmpeg.input(input_video.name)
|
10 |
+
stream = ffmpeg.output(stream, output_filename, vcodec='libx264', acodec='aac')
|
11 |
+
ffmpeg.run(stream)
|
12 |
+
|
13 |
+
return output_filename
|
14 |
+
|
15 |
+
# Gradio interface
|
16 |
+
iface = gr.Interface(
|
17 |
+
fn=convert_to_mp4,
|
18 |
+
inputs=gr.inputs.File(type="file", label="Upload Video"),
|
19 |
+
outputs=gr.outputs.Video(label="Converted MP4 Video"),
|
20 |
+
title="Video to MP4 Converter",
|
21 |
+
description="A simple tool to convert videos to MP4 format using FFmpeg."
|
22 |
+
)
|
23 |
+
|
24 |
+
if __name__ == "__main__":
|
25 |
+
iface.launch()
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
gradio
|
2 |
+
ffmpeg-python
|