Usage Guide
Complete guide to using the Anime FFmpeg Re-Encoder notebook.
Workflow Overview
graph LR
A[Configure] --> B[Download]
B --> C[Encode]
C --> D[Upload to Drive]
D --> E[Auto Shutdown]
style A fill:#2196F3
style B fill:#4CAF50
style C fill:#FF9800
style D fill:#9C27B0
style E fill:#F44336Basic Usage
1. Open and Configure
- Open the notebook in Google Colab
- Mount Google Drive (Cell 1)
- Configure settings (Cell 2)
2. Set Download URL
DOWNLOAD_URL = "https://nyaa.si/download/1234567.torrent"Supported formats:
- Torrent files (
.torrent) - Magnet links (
magnet:?xt=...) - Direct HTTP/HTTPS links
- FTP links
3. Choose Profile
SELECTED_PROFILE = "Balanced 1080p" # Change as needed4. Run Workflow
Execute the main workflow cell and wait for completion.
Advanced Usage
Batch Processing
Process multiple files at once:
# Download season pack
DOWNLOAD_URL = "https://nyaa.si/download/season-pack.torrent"
# All episodes will be processed automaticallyThe workflow will:
- Download all files
- Find all video files in temp folder
- Encode each one sequentially
- Upload all to Drive
Manual File Placement
Skip download step by placing files manually:
# Disable download
ENABLE_DOWNLOAD = False
ENABLE_ENCODE = True
# Place your .mkv/.mp4 files in:
# /content/temp_downloads/
# Workflow will encode the latest fileRe-encode Existing Files
Already have files in temp folder?
# Skip download
ENABLE_DOWNLOAD = False
# Find and encode latest video
latest_video = find_latest_video()
if latest_video:
encoded_path = encode_video(latest_video, profile, USE_GPU)Custom Output Location
Change where encoded files go:
DRIVE_OUTPUT_FOLDER = "/content/drive/MyDrive/Custom/Path"
os.makedirs(DRIVE_OUTPUT_FOLDER, exist_ok=True)Workflow Control
Enable/Disable Steps
Control which steps run:
ENABLE_DOWNLOAD = True # Download step
ENABLE_ENCODE = True # Encoding step
ENABLE_MOVE_TO_DRIVE = True # Upload step
ENABLE_AUTO_SHUTDOWN = False # Auto shutdownExample scenarios:
Download Only:
ENABLE_DOWNLOAD = True
ENABLE_ENCODE = False
ENABLE_MOVE_TO_DRIVE = FalseEncode Only:
ENABLE_DOWNLOAD = False
ENABLE_ENCODE = True
ENABLE_MOVE_TO_DRIVE = TrueRe-upload Existing:
ENABLE_DOWNLOAD = False
ENABLE_ENCODE = False
ENABLE_MOVE_TO_DRIVE = TrueAuto Shutdown
Save Colab compute units:
ENABLE_AUTO_SHUTDOWN = True
SHUTDOWN_DELAY = 10 # Seconds before shutdownWhen enabled, the runtime will:
- Verify file exists in Drive
- Display file size and location
- Wait for delay period
- Disconnect runtime
Auto Shutdown
Make sure files are in Drive before enabling! Check output logs to verify upload success.
Download Options
aria2 Configuration
Fine-tune download behavior:
ARIA2_CONCURRENT = 16 # Connections per server
ARIA2_SPLIT = 16 # Connections per file
ARIA2_MAX_JOBS = 5 # Parallel downloads
ARIA2_SEED_TIME = 0 # Torrent seeding time (seconds)
ARIA2_BT_STOP_TIMEOUT = 300 # BT timeoutHigh-speed connection:
ARIA2_CONCURRENT = 32
ARIA2_SPLIT = 32Slow connection:
ARIA2_CONCURRENT = 8
ARIA2_SPLIT = 8Torrent-Specific Settings
For torrents, you can adjust:
ARIA2_SEED_TIME = 3600 # Seed for 1 hour after download
ARIA2_BT_STOP_TIMEOUT = 600 # Wait longer for peersSeeding Etiquette
Consider seeding for a while to help the community. Set ARIA2_SEED_TIME to non-zero value.
Encoding Options
GPU vs CPU
GPU Encoding (NVENC):
USE_GPU = TruePros:
- 5-10x faster
- Low CPU usage
- Good quality
- Free GPU on Colab
Cons:
- Slightly larger files
- Fixed presets
- GPU must be available
CPU Encoding (x265):
USE_GPU = FalsePros:
- Best quality
- Better compression
- More control
- Works without GPU
Cons:
- Much slower (0.5-1.5x realtime)
- High CPU usage
- Takes longer
When to Use CPU
Use CPU encoding when:
- Maximum quality needed
- Encoding for archival
- GPU not available
- You have time to wait
When to Use GPU
Use GPU encoding when:
- Speed is priority
- Good quality is sufficient
- Batch processing many files
- Using Colab Free tier efficiently
Monitoring Progress
Download Progress
[#1 50MiB/350MiB(14%) CN:16 DL:15MiB ETA:20s]50MiB/350MiB: Downloaded / Total14%: ProgressCN:16: Active connectionsDL:15MiB: Download speedETA:20s: Estimated time
Encoding Progress
frame= 5234 fps=182 q=24.0 size=145MiB time=00:03:38 bitrate=5432kbits/s speed=7.6xframe=5234: Frames processedfps=182: Processing speedq=24.0: Quality targetsize=145MiB: Current output sizetime=00:03:38: Video duration processedspeed=7.6x: Real-time multiplier
Upload Progress
Successfully moved to Google Drive
-rw------- 1 root root 682M Jan 25 12:34 output.mkvShows file size and timestamp.
File Naming
Input Files
Supported:
[Group] Anime Name - 01 (1080p).mkvAnime.Name.S01E01.1080p.mkvanime_name_01.mp4- Any
.mkv,.mp4,.webm
Output Files
Automatically adds quality suffix:
Input: anime_name_01.mkv
Output: anime_name_01_1080p.mkv
anime_name_01_720p.mkv (if 720p profile)Storage Management
Check Available Space
Before encoding:
!df -h /content/drive
!du -sh /content/temp_downloadsCleanup Temp Files
After encoding:
!rm -rf /content/temp_downloads/*Drive Storage
Monitor Drive usage:
from shutil import disk_usage
total, used, free = disk_usage("/content/drive")
print(f"Drive Free: {free / (1024**3):.2f} GB")Tips & Best Practices
1. Test First
Always test with a single short video before batch processing:
# Test with 5-10 minute video
# Verify settings
# Check output quality
# Then proceed with full episodes2. Keep Runtime Alive
Colab may disconnect if idle:
- Keep browser tab active
- Check progress periodically
- Use Colab Pro for longer runtimes
3. Optimize for Your Use
Match profile to use case:
- Streaming: Balanced 1080p
- Mobile: Mobile 480p
- Archive: High Quality 1080p
- Space-limited: Small 720p
4. Batch Smartly
Don't process too many at once:
- Free tier: 3-5 episodes max
- Colab Pro: 10-12 episodes
- Monitor runtime limits
5. Verify Output
Always check encoded file:
!mediainfo /path/to/encoded.mkvLook for:
- Correct resolution
- HEVC codec
- 10-bit color
- Reasonable file size
Common Workflows
Weekly Episode Encoding
# Configure once
SELECTED_PROFILE = "Balanced 1080p"
USE_GPU = True
ENABLE_AUTO_SHUTDOWN = True
# Each week:
# 1. Update DOWNLOAD_URL
# 2. Run workflow cell
# 3. Wait for completionSeason Batch Processing
# Download season pack
DOWNLOAD_URL = "season-pack.torrent"
ENABLE_AUTO_SHUTDOWN = False # Process all before shutdown
# Process all episodes
# Monitor progress
# Manually shutdown when doneQuality Testing
# Test different profiles
for profile_name in ["Balanced 1080p", "Small 720p", "Mobile 480p"]:
SELECTED_PROFILE = profile_name
# Encode same clip
# Compare results