Skip to content

Commit 8c96f0f

Browse files
committed
Cloned
1 parent 662c6b1 commit 8c96f0f

File tree

3,574 files changed

+244118
-862183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,574 files changed

+244118
-862183
lines changed

.DS_Store

-8 KB
Binary file not shown.

.vscode/settings.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

A/Alzheimer-Disease-Prediction-using-ML/oasis_longitudinal.csv

Lines changed: 374 additions & 374 deletions
Large diffs are not rendered by default.

A/Anti-Malware_application/database3.csv

100755100644
Lines changed: 639 additions & 639 deletions
Large diffs are not rendered by default.

A/add-audio-to-video/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
2-
- `pip3 install -r requirements.txt`
3-
- `python add_audio_to_video_movie.py --help`
1+
2+
- `pip3 install -r requirements.txt`
3+
- `python add_audio_to_video_movie.py --help`
Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,56 @@
1-
# Techiral
2-
3-
from moviepy.editor import VideoFileClip, AudioFileClip, CompositeAudioClip
4-
5-
def add_audio_to_video_movie(
6-
video_file,
7-
audio_file,
8-
start,
9-
end,
10-
composite,
11-
volume_factor
12-
):
13-
# print the passed parameters, just for logging
14-
print(vars(args))
15-
# load the video
16-
video_clip = VideoFileClip(video_file)
17-
# load the audio
18-
audio_clip = AudioFileClip(audio_file)
19-
# use the volume factor to increase/decrease volume
20-
audio_clip = audio_clip.volumex(volume_factor)
21-
# if end is not set, use video clip's end
22-
if not end:
23-
end = video_clip.end
24-
# make sure audio clip is less than video clip in duration
25-
# setting the start & end of the audio clip to `start` and `end` paramters
26-
audio_clip = audio_clip.subclip(start, end)
27-
# composite with the existing audio in the video if composite parameter is set
28-
final_audio = audio_clip
29-
if composite:
30-
final_audio = CompositeAudioClip([video_clip.audio, audio_clip])
31-
# add the final audio to the video
32-
final_clip = video_clip.set_audio(final_audio)
33-
# save the final clip
34-
final_clip.write_videofile("final.mp4")
35-
36-
37-
if __name__ == "__main__":
38-
import argparse
39-
# make a command-line argument parser & add various parameters
40-
parser = argparse.ArgumentParser(description="Python script to add audio to video clip")
41-
parser.add_argument("-v", "--video-file", help="Target video file")
42-
parser.add_argument("-a", "--audio-file", help="Target audio file to embed with the video")
43-
parser.add_argument("-s", "--start", help="Start duration of the audio file, default is 0", default=0, type=int)
44-
parser.add_argument("-e", "--end", help="The end duration of the audio file, default is the length of the video file", type=int)
45-
parser.add_argument("-c", "--composite", help="Whether to add to the existing audio in the video", action="store_true", default=False)
46-
parser.add_argument("-f", "--volume-factor", type=float, default=1.0, help="The volume factor to multiply by the volume of the audio file, 1 means no change, below 1 will decrease volume, above will increase.")
47-
# parse the arguments
48-
args = parser.parse_args()
49-
add_audio_to_video_movie(
50-
args.video_file,
51-
args.audio_file,
52-
args.start,
53-
args.end,
54-
args.composite,
55-
args.volume_factor
56-
)
1+
# Techiral
2+
3+
from moviepy.editor import VideoFileClip, AudioFileClip, CompositeAudioClip
4+
5+
def add_audio_to_video_movie(
6+
video_file,
7+
audio_file,
8+
start,
9+
end,
10+
composite,
11+
volume_factor
12+
):
13+
# print the passed parameters, just for logging
14+
print(vars(args))
15+
# load the video
16+
video_clip = VideoFileClip(video_file)
17+
# load the audio
18+
audio_clip = AudioFileClip(audio_file)
19+
# use the volume factor to increase/decrease volume
20+
audio_clip = audio_clip.volumex(volume_factor)
21+
# if end is not set, use video clip's end
22+
if not end:
23+
end = video_clip.end
24+
# make sure audio clip is less than video clip in duration
25+
# setting the start & end of the audio clip to `start` and `end` paramters
26+
audio_clip = audio_clip.subclip(start, end)
27+
# composite with the existing audio in the video if composite parameter is set
28+
final_audio = audio_clip
29+
if composite:
30+
final_audio = CompositeAudioClip([video_clip.audio, audio_clip])
31+
# add the final audio to the video
32+
final_clip = video_clip.set_audio(final_audio)
33+
# save the final clip
34+
final_clip.write_videofile("final.mp4")
35+
36+
37+
if __name__ == "__main__":
38+
import argparse
39+
# make a command-line argument parser & add various parameters
40+
parser = argparse.ArgumentParser(description="Python script to add audio to video clip")
41+
parser.add_argument("-v", "--video-file", help="Target video file")
42+
parser.add_argument("-a", "--audio-file", help="Target audio file to embed with the video")
43+
parser.add_argument("-s", "--start", help="Start duration of the audio file, default is 0", default=0, type=int)
44+
parser.add_argument("-e", "--end", help="The end duration of the audio file, default is the length of the video file", type=int)
45+
parser.add_argument("-c", "--composite", help="Whether to add to the existing audio in the video", action="store_true", default=False)
46+
parser.add_argument("-f", "--volume-factor", type=float, default=1.0, help="The volume factor to multiply by the volume of the audio file, 1 means no change, below 1 will decrease volume, above will increase.")
47+
# parse the arguments
48+
args = parser.parse_args()
49+
add_audio_to_video_movie(
50+
args.video_file,
51+
args.audio_file,
52+
args.start,
53+
args.end,
54+
args.composite,
55+
args.volume_factor
56+
)

A/add-photo-to-audio/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
2-
- `pip3 install -r requirements.txt`
1+
2+
- `pip3 install -r requirements.txt`
Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
#Techiral
2-
3-
from moviepy.editor import AudioFileClip, ImageClip
4-
5-
6-
def add_static_image_to_audio(image_path, audio_path, output_path):
7-
"""Create and save a video file to `output_path` after
8-
combining a static image that is located in `image_path`
9-
with an audio file in `audio_path`"""
10-
# create the audio clip object
11-
audio_clip = AudioFileClip(audio_path)
12-
# create the image clip object
13-
image_clip = ImageClip(image_path)
14-
# use set_audio method from image clip to combine the audio with the image
15-
video_clip = image_clip.set_audio(audio_clip)
16-
# specify the duration of the new clip to be the duration of the audio clip
17-
video_clip.duration = audio_clip.duration
18-
# set the FPS to 1
19-
video_clip.fps = 1
20-
# write the resuling video clip
21-
video_clip.write_videofile(output_path)
22-
23-
24-
25-
26-
if __name__ == "__main__":
27-
import argparse
28-
parser = argparse.ArgumentParser(description="Simple Python script to add a static image to an audio to make a video")
29-
parser.add_argument("image", help="The image path")
30-
parser.add_argument("audio", help="The audio path")
31-
parser.add_argument("output", help="The output video file path")
32-
args = parser.parse_args()
1+
#Techiral
2+
3+
from moviepy.editor import AudioFileClip, ImageClip
4+
5+
6+
def add_static_image_to_audio(image_path, audio_path, output_path):
7+
"""Create and save a video file to `output_path` after
8+
combining a static image that is located in `image_path`
9+
with an audio file in `audio_path`"""
10+
# create the audio clip object
11+
audio_clip = AudioFileClip(audio_path)
12+
# create the image clip object
13+
image_clip = ImageClip(image_path)
14+
# use set_audio method from image clip to combine the audio with the image
15+
video_clip = image_clip.set_audio(audio_clip)
16+
# specify the duration of the new clip to be the duration of the audio clip
17+
video_clip.duration = audio_clip.duration
18+
# set the FPS to 1
19+
video_clip.fps = 1
20+
# write the resuling video clip
21+
video_clip.write_videofile(output_path)
22+
23+
24+
25+
26+
if __name__ == "__main__":
27+
import argparse
28+
parser = argparse.ArgumentParser(description="Simple Python script to add a static image to an audio to make a video")
29+
parser.add_argument("image", help="The image path")
30+
parser.add_argument("audio", help="The audio path")
31+
parser.add_argument("output", help="The output video file path")
32+
args = parser.parse_args()
3333
add_static_image_to_audio(args.image, args.audio, args.output)

A/add-watermark-pdf/README.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
2-
- `pip3 install -r requirements.txt`
3-
- ```python pdf_watermarker.py --help```
4-
5-
**Output:**
6-
7-
```
8-
Available Options
9-
10-
optional arguments:
11-
-h, --help show this help message and exit
12-
-i INPUT_PATH, --input_path INPUT_PATH
13-
Enter the path of the file or the folder to process
14-
-a {watermark,unwatermark}, --action {watermark,unwatermark}
15-
Choose whether to watermark or to unwatermark
16-
-m {RAM,HDD}, --mode {RAM,HDD}
17-
Choose whether to process on the hard disk drive or in memory
18-
-w WATERMARK_TEXT, --watermark_text WATERMARK_TEXT
19-
Enter a valid watermark text
20-
-p PAGES, --pages PAGES
21-
Enter the pages to consider e.g.: [2,4]
22-
```
23-
24-
- To add a watermark with any text on `lorem-ipsum.pdf` file and output it as `watermarked_lorem-ipsum.pdf`:
25-
26-
```
27-
python pdf_watermarker.py -i lorem-ipsum.pdf -a watermark -w "text here" -o watermarked_lorem-ipsum.pdf
28-
```
1+
2+
- `pip3 install -r requirements.txt`
3+
- ```python pdf_watermarker.py --help```
4+
5+
**Output:**
6+
7+
```
8+
Available Options
9+
10+
optional arguments:
11+
-h, --help show this help message and exit
12+
-i INPUT_PATH, --input_path INPUT_PATH
13+
Enter the path of the file or the folder to process
14+
-a {watermark,unwatermark}, --action {watermark,unwatermark}
15+
Choose whether to watermark or to unwatermark
16+
-m {RAM,HDD}, --mode {RAM,HDD}
17+
Choose whether to process on the hard disk drive or in memory
18+
-w WATERMARK_TEXT, --watermark_text WATERMARK_TEXT
19+
Enter a valid watermark text
20+
-p PAGES, --pages PAGES
21+
Enter the pages to consider e.g.: [2,4]
22+
```
23+
24+
- To add a watermark with any text on `lorem-ipsum.pdf` file and output it as `watermarked_lorem-ipsum.pdf`:
25+
26+
```
27+
python pdf_watermarker.py -i lorem-ipsum.pdf -a watermark -w "text here" -o watermarked_lorem-ipsum.pdf
28+
```

0 commit comments

Comments
 (0)