Add a logo watermark (from D:\logo\logo_black_text.png) to mp4 videos placed in
D:\workspace\. After processing, source videos are moved to
D:\workspace\完成\源文件\ and watermarked videos to D:\workspace\完成\增加logo\.
List mp4 files in D:\workspace\ root that do NOT already have _with_logo in
their name:
Get-ChildItem -Path D:\workspace -Filter *.mp4 -File |
Where-Object { $_.BaseName -notmatch "_with_logo$" } |
Select-Object Name, @{N="SizeMB";E={[math]::Round($_.Length/1MB,1)}}
The processing script is scripts/add_logo.py. Copy it to D:\workspace\add_logo.py
before running. Modify the tasks list at the top of the script with the discovered
filenames:
tasks = [
("filename1.mp4", 0.25, "bottom-center"),
("filename2.mp4", 0.25, "bottom-center"),
]
Each task tuple: (filename, logo_width_ratio, position).
Position options:
"bottom-center" — centered at bottom, 20px margin from edge
"bottom-right" — bottom-right corner, 20px margin
(x, y) — custom pixel coordinates
& "C:\Users\Administrator\.workbuddy\binaries\python\envs\default\Scripts\python.exe" D:\workspace\add_logo.py
The script:
{name}_with_logo.mp4
完成\源文件\, output → 完成\增加logo\
_with_logo output
After processing, deliver the watermarked video(s) from
D:\workspace\完成\增加logo\ using deliver_attachments.
C:\Users\Administrator\.workbuddy\binaries\python\envs\default\
D:\logo\logo_black_text.png
scripts/add_logo.py (copy to D:\workspace\add_logo.py before running)
| Parameter | Default | Notes |
|-----------|---------|-------|
| Position | bottom-center | Also supports bottom-right, custom (x,y) |
| Logo width | 25% of video width | Range typically 15%-50% |
| Margin | 20px | From edge of video |
| Archive source | D:\workspace\完成\源文件\ | Auto-created if missing |
| Archive output | D:\workspace\完成\增加logo\ | Auto-created if missing |
_with_logo counterpart, it is skipped
YYYY-MM-DD.md and MEMORY.md) after each batch
共 1 个版本