fid-ffmpeg 0.3.4__py3-none-any.whl

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/__init__.py ADDED
File without changes
fid/fid.py ADDED
@@ -0,0 +1,66 @@
1
+ import typer
2
+ import subprocess
3
+ from pathlib import Path
4
+ import shutil
5
+ app = typer.Typer()
6
+
7
+ formats = [".mp4",".mov",".avi",".webm"]
8
+
9
+ def ffmpeg():
10
+ if shutil.which("ffmpeg")is None:
11
+ print("ffmpeg isn't installed\n download from: https://ffmpeg.org/download.html")
12
+ raise typer.Exit()
13
+
14
+ def ckvideo(vid:Path):
15
+ if not vid.exists():
16
+ print("file doesn't exist")
17
+ raise typer.Exit()
18
+
19
+
20
+
21
+ @app.command()
22
+ def info(vid: Path):
23
+ ffmpeg()
24
+ ckvideo(vid)
25
+ subprocess.run(["ffprobe", "-v", "error", "-show_format", "-show_streams", str(vid)], check=True)
26
+
27
+ @app.command()
28
+ def audio(vid: Path):
29
+ ffmpeg()
30
+ ckvideo(vid)
31
+ audio=vid.with_suffix(".mp3")
32
+ subprocess.run(["ffmpeg", "-i", str(vid), "-vn", "-acodec", "mp3", "-y", str(audio)], check=True)
33
+
34
+
35
+ @app.command()
36
+ def frames(vid: Path):
37
+ ffmpeg()
38
+ ckvideo(vid)
39
+ Fdir= vid.parent
40
+ frames= Fdir / "Frames" / vid.stem
41
+ frames.mkdir(parents=True,exist_ok=True)
42
+ subprocess.run(["ffmpeg", "-i", str(vid),str(frames/ "frame_%02d.png")],check=True )
43
+
44
+ @app.command()
45
+ def gif(vid: Path):
46
+ ffmpeg()
47
+ ckvideo(vid)
48
+ gif=vid.with_suffix(".gif")
49
+ subprocess.run(["ffmpeg", "-i", str(vid), "-t", "3", "-vf", "scale=320:-1", "-y", str(gif)], check=True)
50
+
51
+ @app.command()
52
+ def mute(vid: Path):
53
+ ffmpeg()
54
+ ckvideo(vid)
55
+ mute=vid.with_stem(f"{vid.stem}_muted").with_suffix(vid.suffix)
56
+ subprocess.run(["ffmpeg", "-i", str(vid), "-c", "copy", "-an", "-y", str(mute)], check=True)
57
+
58
+ @app.command()
59
+ def compress(vid: Path, crf: int=28):
60
+ ffmpeg()
61
+ ckvideo(vid)
62
+ compress= vid.with_stem(f"{vid.stem}_compressed").with_suffix(".mkv")
63
+ 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)
64
+
65
+ if __name__=="__main__":
66
+ app()
@@ -0,0 +1,33 @@
1
+ Metadata-Version: 2.4
2
+ Name: fid-ffmpeg
3
+ Version: 0.3.4
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
+ simple ffmpeg based cli for video operations
13
+
14
+ ## installation
15
+
16
+ - you need to install python >=3.9 : [Download Python](https://www.python.org/downloads/)
17
+ - install ffmpeg : [Download FFmpeg](https://www.ffmpeg.org/download.html)
18
+ - then install fid-cli with pip :
19
+ ```bash
20
+ pip install fid-ffmpeg
21
+ ```
22
+ ## installation demo
23
+ https://github.com/user-attachments/assets/5c1bb2ac-1793-44b8-8240-bc71a1919d5a
24
+
25
+ ## Commands
26
+ | Command | Description |
27
+ |---------|------------|
28
+ | `fid --help` | show help for fid cli |
29
+ | `fid info "videoPath"` | `to know all info about the video` |
30
+ | `fid audio "videoPath"` | `extract audio from the video` |
31
+ | `fid mute "videoPath"` | `mute the video` |
32
+ | `fid gif "videoPath"` | `make a gif from the video` |
33
+ | `fid frames "videoPath"` | `extract all video frames and add them in a folder`|
@@ -0,0 +1,8 @@
1
+ fid/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ fid/fid.py,sha256=O6PpCUMSlfaAl5_OSW-pLNhiHVuWy__t6u00jrcsaaU,1926
3
+ fid_ffmpeg-0.3.4.dist-info/licenses/LICENSE,sha256=8HFb3MtS3r_RTfGUr8mm6IbZocu4o4vc2f2U00Z3Tmc,255
4
+ fid_ffmpeg-0.3.4.dist-info/METADATA,sha256=hFxzXVZj5JQIJGdFlNVkFNsEyGkZlYdMAH_5MyuQlDI,1126
5
+ fid_ffmpeg-0.3.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
+ fid_ffmpeg-0.3.4.dist-info/entry_points.txt,sha256=wc8Iju3nkXAuyqF5NB1276l_AGtakuifMGR3D42dqB8,36
7
+ fid_ffmpeg-0.3.4.dist-info/top_level.txt,sha256=5jgogeo314G3j_oXUp3BE4wBE3t82ijRwLwF1KnYiDg,4
8
+ fid_ffmpeg-0.3.4.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ fid = fid.fid:app
@@ -0,0 +1,8 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Omar Abdalgwad
4
+
5
+ Permission is granted to use, copy, modify, and distribute this software for any purpose,
6
+ with or without fee, provided this notice is included.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY
@@ -0,0 +1 @@
1
+ fid