fid-ffmpeg 0.3.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fid_ffmpeg-0.3.9/LICENSE +8 -0
- fid_ffmpeg-0.3.9/PKG-INFO +42 -0
- fid_ffmpeg-0.3.9/README.md +32 -0
- fid_ffmpeg-0.3.9/fid/__init__.py +0 -0
- fid_ffmpeg-0.3.9/fid/fid.py +72 -0
- fid_ffmpeg-0.3.9/fid/welcome.py +23 -0
- fid_ffmpeg-0.3.9/fid_ffmpeg.egg-info/PKG-INFO +42 -0
- fid_ffmpeg-0.3.9/fid_ffmpeg.egg-info/SOURCES.txt +12 -0
- fid_ffmpeg-0.3.9/fid_ffmpeg.egg-info/dependency_links.txt +1 -0
- fid_ffmpeg-0.3.9/fid_ffmpeg.egg-info/entry_points.txt +2 -0
- fid_ffmpeg-0.3.9/fid_ffmpeg.egg-info/requires.txt +1 -0
- fid_ffmpeg-0.3.9/fid_ffmpeg.egg-info/top_level.txt +1 -0
- fid_ffmpeg-0.3.9/pyproject.toml +12 -0
- fid_ffmpeg-0.3.9/setup.cfg +4 -0
fid_ffmpeg-0.3.9/LICENSE
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fid-ffmpeg
|
|
3
|
+
Version: 0.3.9
|
|
4
|
+
Summary: based ffmpeg CLI for video operations
|
|
5
|
+
Author-email: omar_abdalgwad <ahlawyomar95@gmail.com>
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Dist: typer>=0.7
|
|
9
|
+
Dynamic: license-file
|
|
10
|
+
|
|
11
|
+
# fid-ffmpeg
|
|
12
|
+
ffmpeg based cli for video operations
|
|
13
|
+
```bash
|
|
14
|
+
fid
|
|
15
|
+
```
|
|
16
|
+
https://github.com/user-attachments/assets/abcc8aa0-3ada-4548-8f99-987687cfccd9
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
https://github.com/user-attachments/assets/abcc8aa0-3ada-4548-8f99-987687cfccd9
|
|
20
|
+
|
|
21
|
+
## installation
|
|
22
|
+
|
|
23
|
+
- you need to install python >=3.9 : [Download Python](https://www.python.org/downloads/)
|
|
24
|
+
- install ffmpeg : [Download FFmpeg](https://www.ffmpeg.org/download.html)
|
|
25
|
+
- then install fid-cli with pip :
|
|
26
|
+
```bash
|
|
27
|
+
pip install fid-ffmpeg
|
|
28
|
+
```
|
|
29
|
+
## installation demo
|
|
30
|
+
https://github.com/user-attachments/assets/6063b46b-dd4a-4cb3-a318-869f37bcf60f
|
|
31
|
+
|
|
32
|
+
## Commands
|
|
33
|
+
| Command | Description |
|
|
34
|
+
|---------|------------|
|
|
35
|
+
| `fid --help` | show help for fid cli |
|
|
36
|
+
| `fid info "videoPath"` | `to know all info about the video` |
|
|
37
|
+
| `fid audio "videoPath"` | `extract audio from the video` |
|
|
38
|
+
| `fid mute "videoPath"` | `mute the video` |
|
|
39
|
+
| `fid gif "videoPath"` | `make a gif from the video` |
|
|
40
|
+
| `fid frames "videoPath"` | `extract all video frames and add them in a folder`|
|
|
41
|
+
| `fid frames "videoPath"` | `extract all video frames and add them in a folder`|
|
|
42
|
+
| `fid compress "videoPath"` | `Compress the video to reduce its file size`|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# fid-ffmpeg
|
|
2
|
+
ffmpeg based cli for video operations
|
|
3
|
+
```bash
|
|
4
|
+
fid
|
|
5
|
+
```
|
|
6
|
+
https://github.com/user-attachments/assets/abcc8aa0-3ada-4548-8f99-987687cfccd9
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
https://github.com/user-attachments/assets/abcc8aa0-3ada-4548-8f99-987687cfccd9
|
|
10
|
+
|
|
11
|
+
## installation
|
|
12
|
+
|
|
13
|
+
- you need to install python >=3.9 : [Download Python](https://www.python.org/downloads/)
|
|
14
|
+
- install ffmpeg : [Download FFmpeg](https://www.ffmpeg.org/download.html)
|
|
15
|
+
- then install fid-cli with pip :
|
|
16
|
+
```bash
|
|
17
|
+
pip install fid-ffmpeg
|
|
18
|
+
```
|
|
19
|
+
## installation demo
|
|
20
|
+
https://github.com/user-attachments/assets/6063b46b-dd4a-4cb3-a318-869f37bcf60f
|
|
21
|
+
|
|
22
|
+
## Commands
|
|
23
|
+
| Command | Description |
|
|
24
|
+
|---------|------------|
|
|
25
|
+
| `fid --help` | show help for fid cli |
|
|
26
|
+
| `fid info "videoPath"` | `to know all info about the video` |
|
|
27
|
+
| `fid audio "videoPath"` | `extract audio from the video` |
|
|
28
|
+
| `fid mute "videoPath"` | `mute the video` |
|
|
29
|
+
| `fid gif "videoPath"` | `make a gif from the video` |
|
|
30
|
+
| `fid frames "videoPath"` | `extract all video frames and add them in a folder`|
|
|
31
|
+
| `fid frames "videoPath"` | `extract all video frames and add them in a folder`|
|
|
32
|
+
| `fid compress "videoPath"` | `Compress the video to reduce its file size`|
|
|
File without changes
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import typer
|
|
2
|
+
import subprocess
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
import shutil
|
|
5
|
+
from .welcome import welcome
|
|
6
|
+
app = typer.Typer()
|
|
7
|
+
|
|
8
|
+
formats = [".mp4",".mov",".avi",".webm"]
|
|
9
|
+
|
|
10
|
+
@app.callback(invoke_without_command=True)
|
|
11
|
+
def start(ctx : typer.Context):
|
|
12
|
+
if ctx.invoked_subcommand is None:
|
|
13
|
+
welcome()
|
|
14
|
+
|
|
15
|
+
def ffmpeg():
|
|
16
|
+
if shutil.which("ffmpeg")is None:
|
|
17
|
+
print("ffmpeg isn't installed\n download from: https://ffmpeg.org/download.html")
|
|
18
|
+
raise typer.Exit()
|
|
19
|
+
|
|
20
|
+
def ckvideo(vid:Path):
|
|
21
|
+
if not vid.exists():
|
|
22
|
+
print("file doesn't exist")
|
|
23
|
+
raise typer.Exit()
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@app.command()
|
|
27
|
+
def info(vid: Path):
|
|
28
|
+
ffmpeg()
|
|
29
|
+
ckvideo(vid)
|
|
30
|
+
subprocess.run(["ffprobe", "-v", "error", "-show_format", "-show_streams", str(vid)], check=True)
|
|
31
|
+
|
|
32
|
+
@app.command()
|
|
33
|
+
def audio(vid: Path):
|
|
34
|
+
ffmpeg()
|
|
35
|
+
ckvideo(vid)
|
|
36
|
+
audio=vid.with_suffix(".mp3")
|
|
37
|
+
subprocess.run(["ffmpeg", "-i", str(vid), "-vn", "-acodec", "libmp3lame", "-y", str(audio)], check=True)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@app.command()
|
|
41
|
+
def frames(vid: Path):
|
|
42
|
+
ffmpeg()
|
|
43
|
+
ckvideo(vid)
|
|
44
|
+
Fdir= vid.parent
|
|
45
|
+
frames= Fdir / "Frames" / vid.stem
|
|
46
|
+
frames.mkdir(parents=True,exist_ok=True)
|
|
47
|
+
subprocess.run(["ffmpeg", "-i", str(vid),str(frames/ "frame_%02d.png")],check=True )
|
|
48
|
+
|
|
49
|
+
@app.command()
|
|
50
|
+
def gif(vid: Path):
|
|
51
|
+
ffmpeg()
|
|
52
|
+
ckvideo(vid)
|
|
53
|
+
gif=vid.with_suffix(".gif")
|
|
54
|
+
subprocess.run(["ffmpeg", "-i", str(vid), "-t", "5", "-vf", "scale=320:-1", "-y", str(gif)], check=True)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
@app.command()
|
|
58
|
+
def mute(vid: Path):
|
|
59
|
+
ffmpeg()
|
|
60
|
+
ckvideo(vid)
|
|
61
|
+
mute=vid.with_stem(f"{vid.stem}_muted").with_suffix(vid.suffix)
|
|
62
|
+
subprocess.run(["ffmpeg", "-i", str(vid), "-c", "copy", "-an", "-y", str(mute)], check=True)
|
|
63
|
+
|
|
64
|
+
@app.command()
|
|
65
|
+
def compress(vid: Path, crf: int=28):
|
|
66
|
+
ffmpeg()
|
|
67
|
+
ckvideo(vid)
|
|
68
|
+
compress= vid.with_stem(f"{vid.stem}_compressed").with_suffix(".mkv")
|
|
69
|
+
subprocess.run(["ffmpeg", "-i", str(vid),"-c:v", "libx264", "-crf", str(crf), "-preset","medium","-c:a","aac","-b:a","96k","-y",str(compress),], check=True)
|
|
70
|
+
|
|
71
|
+
if __name__=="__main__":
|
|
72
|
+
app()
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from rich.console import Console
|
|
2
|
+
from rich.panel import Panel
|
|
3
|
+
from rich.text import Text
|
|
4
|
+
import pyfiglet
|
|
5
|
+
|
|
6
|
+
console = Console()
|
|
7
|
+
|
|
8
|
+
def welcome():
|
|
9
|
+
ascii=pyfiglet.figlet_format("fid-ffmpeg",font="slant")
|
|
10
|
+
logo = Text(ascii)
|
|
11
|
+
logo.stylize("bold gradient(blue, magenta)")
|
|
12
|
+
console.print(logo, justify="center")
|
|
13
|
+
content =(
|
|
14
|
+
"[bold]fid-ffmpeg Helper[/bold]\n\n"
|
|
15
|
+
"[green]Commands:[/green]\n"
|
|
16
|
+
" • info Show video info\n"
|
|
17
|
+
" • audio Extract audio\n"
|
|
18
|
+
" • frames Extract frames\n"
|
|
19
|
+
" • gif Create gif\n"
|
|
20
|
+
" • mute Remove audio\n"
|
|
21
|
+
" • compress Compress video\n\n"
|
|
22
|
+
"[dim]Run : fid <command> <video path>[/dim]")
|
|
23
|
+
console.print(Panel(content,title="fid-ffmpeg",border_style="cyan",expand=True))
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fid-ffmpeg
|
|
3
|
+
Version: 0.3.9
|
|
4
|
+
Summary: based ffmpeg CLI for video operations
|
|
5
|
+
Author-email: omar_abdalgwad <ahlawyomar95@gmail.com>
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Dist: typer>=0.7
|
|
9
|
+
Dynamic: license-file
|
|
10
|
+
|
|
11
|
+
# fid-ffmpeg
|
|
12
|
+
ffmpeg based cli for video operations
|
|
13
|
+
```bash
|
|
14
|
+
fid
|
|
15
|
+
```
|
|
16
|
+
https://github.com/user-attachments/assets/abcc8aa0-3ada-4548-8f99-987687cfccd9
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
https://github.com/user-attachments/assets/abcc8aa0-3ada-4548-8f99-987687cfccd9
|
|
20
|
+
|
|
21
|
+
## installation
|
|
22
|
+
|
|
23
|
+
- you need to install python >=3.9 : [Download Python](https://www.python.org/downloads/)
|
|
24
|
+
- install ffmpeg : [Download FFmpeg](https://www.ffmpeg.org/download.html)
|
|
25
|
+
- then install fid-cli with pip :
|
|
26
|
+
```bash
|
|
27
|
+
pip install fid-ffmpeg
|
|
28
|
+
```
|
|
29
|
+
## installation demo
|
|
30
|
+
https://github.com/user-attachments/assets/6063b46b-dd4a-4cb3-a318-869f37bcf60f
|
|
31
|
+
|
|
32
|
+
## Commands
|
|
33
|
+
| Command | Description |
|
|
34
|
+
|---------|------------|
|
|
35
|
+
| `fid --help` | show help for fid cli |
|
|
36
|
+
| `fid info "videoPath"` | `to know all info about the video` |
|
|
37
|
+
| `fid audio "videoPath"` | `extract audio from the video` |
|
|
38
|
+
| `fid mute "videoPath"` | `mute the video` |
|
|
39
|
+
| `fid gif "videoPath"` | `make a gif from the video` |
|
|
40
|
+
| `fid frames "videoPath"` | `extract all video frames and add them in a folder`|
|
|
41
|
+
| `fid frames "videoPath"` | `extract all video frames and add them in a folder`|
|
|
42
|
+
| `fid compress "videoPath"` | `Compress the video to reduce its file size`|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
fid/__init__.py
|
|
5
|
+
fid/fid.py
|
|
6
|
+
fid/welcome.py
|
|
7
|
+
fid_ffmpeg.egg-info/PKG-INFO
|
|
8
|
+
fid_ffmpeg.egg-info/SOURCES.txt
|
|
9
|
+
fid_ffmpeg.egg-info/dependency_links.txt
|
|
10
|
+
fid_ffmpeg.egg-info/entry_points.txt
|
|
11
|
+
fid_ffmpeg.egg-info/requires.txt
|
|
12
|
+
fid_ffmpeg.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
typer>=0.7
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fid
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
[project]
|
|
5
|
+
name = "fid-ffmpeg"
|
|
6
|
+
version = "0.3.9"
|
|
7
|
+
description = " based ffmpeg CLI for video operations"
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
authors = [{ name = "omar_abdalgwad", email = "ahlawyomar95@gmail.com" }]
|
|
10
|
+
dependencies = ["typer>=0.7"]
|
|
11
|
+
[project.scripts]
|
|
12
|
+
fid = "fid.fid:app"
|