🎬 Video Module
The Video module provides simple and powerful utilities for video editing, conversion, compression, audio extraction, watermarking, frame extraction, GIF creation, and metadata inspection.
- Video Conversion
- Merge & Split
- Editing Tools
- Audio Processing
- Frame Extraction
- Compression
- Watermarking
- Effects
- Video Information
- GIF Export
🚀 Quick Example
Convert an MP4 video into AVI.
💻 Code
import allkitpy
allkitpy.video.convert(
"movie.mp4",
"movie.avi"
)
📤 Output
movie.avi
📚 Functions
🎞️ convert()
Convert a video from one format to another.
💻 Code
import allkitpy
allkitpy.video.convert(
"movie.mp4",
"movie.avi"
)
📤 Output
movie.avi
📦 merge()
Merge multiple videos into a single video.
💻 Code
import allkitpy
allkitpy.video.merge(
[
"intro.mp4",
"part1.mp4",
"part2.mp4"
],
"complete.mp4"
)
📤 Output
complete.mp4
✂️ split()
Split a video into equal-length clips.
💻 Code
import allkitpy
allkitpy.video.split(
"movie.mp4",
60,
"part"
)
📤 Output
part_1.mp4
part_2.mp4
part_3.mp4
...
✂️ trim()
Extract a specific portion of a video using start and end times.
💻 Code
import allkitpy
allkitpy.video.trim(
"movie.mp4",
10,
45,
"clip.mp4"
)
📤 Output
clip.mp4
📐 resize()
Resize a video to a custom resolution.
💻 Code
import allkitpy
allkitpy.video.resize(
"movie.mp4",
1280,
720,
"hd.mp4"
)
📤 Output
hd.mp4
🔄 rotate()
Rotate a video by a specified angle.
💻 Code
import allkitpy
allkitpy.video.rotate(
"movie.mp4",
90,
"rotated.mp4"
)
📤 Output
rotated.mp4
🖼️ crop()
Crop a rectangular region from a video.
💻 Code
import allkitpy
allkitpy.video.crop(
"movie.mp4",
100,
50,
900,
650,
"cropped.mp4"
)
📤 Output
cropped.mp4
🎵 extract_audio()
Extract the audio track from a video file.
💻 Code
import allkitpy
allkitpy.video.extract_audio(
"movie.mp4",
"movie.mp3"
)
📤 Output
movie.mp3
🖼️ extract_frames()
Extract video frames as PNG images.
💻 Code
import allkitpy
allkitpy.video.extract_frames(
"movie.mp4",
"frames",
fps=2
)
📤 Output
frames/
frame_00001.png
frame_00002.png
frame_00003.png
...
🎧 add_audio()
Replace the audio track of a video with another audio file.
💻 Code
import allkitpy
allkitpy.video.add_audio(
"video.mp4",
"music.mp3",
"final.mp4"
)
📤 Output
final.mp4
🗜️ compress()
Reduce the file size of a video by lowering its bitrate.
💻 Code
import allkitpy
allkitpy.video.compress(
"movie.mp4",
"compressed.mp4",
bitrate="1000k"
)
📤 Output
compressed.mp4
🏷️ watermark()
Add an image watermark to the bottom-right corner of a video.
💻 Code
import allkitpy
allkitpy.video.watermark(
"movie.mp4",
"logo.png",
"watermarked.mp4"
)
📤 Output
watermarked.mp4
⚡ speed()
Increase or decrease the playback speed of a video.
💻 Code
import allkitpy
allkitpy.video.speed(
"movie.mp4",
2.0,
"fast.mp4"
)
📤 Output
fast.mp4
⏪ reverse()
Play a video from the last frame to the first frame.
💻 Code
import allkitpy
allkitpy.video.reverse(
"movie.mp4",
"reverse.mp4"
)
📤 Output
reverse.mp4
🔇 mute()
Remove the audio track from a video.
💻 Code
import allkitpy
allkitpy.video.mute(
"movie.mp4",
"silent.mp4"
)
📤 Output
silent.mp4
⏱️ duration()
Return the total duration of a video in seconds.
💻 Code
import allkitpy
seconds = allkitpy.video.duration(
"movie.mp4"
)
print(seconds)
📤 Output
125.84
📺 resolution()
Return the width and height of a video.
💻 Code
import allkitpy
size = allkitpy.video.resolution(
"movie.mp4"
)
print(size)
📤 Output
(1920, 1080)
🎞️ fps()
Return the frame rate (frames per second) of a video.
💻 Code
import allkitpy
rate = allkitpy.video.fps(
"movie.mp4"
)
print(rate)
📤 Output
30.0
📋 metadata()
Return basic metadata about a video.
💻 Code
import allkitpy
info = allkitpy.video.metadata(
"movie.mp4"
)
print(info)
📤 Output
{
'duration': 125.84,
'fps': 30.0,
'resolution': (1920,1080)
}
🎬 gif()
Convert a video into an animated GIF.
💻 Code
import allkitpy
allkitpy.video.gif(
"movie.mp4",
"movie.gif"
)
📤 Output
movie.gif