YouTube Shorts Creator — Automatisierte Shorts mit ADB & Python

Erstelle YouTube-Shorts vollautomatisch: Video-Zuschnitt, Text-Overlay, Musik & Upload – alles über Python und Android ADB

PythonADBAndroidmoviepyYouTube

🎬 Shorts-Erstellung auf Autopilot

Automatisieren Sie Ihren YouTube-Shorts-Workflow von Anfang bis Ende

📞 02406 803 7603 ✉️ info@computerkumpel.de

📊 Projektübersicht

Der YouTube-Shorts-Creator automatisiert den kompletten Produktionsprozess von Shorts-Videos. Über ADB wird ein Android-Gerät ferngesteuert, das Video wird via moviepy auf das 9:16-Format zugeschnitten, mit Text-Overlays und Hintergrundmusik versehen und automatisch hochgeladen.

📱
ADB-Steuerung
Fernsteuerung eines Android-Geräts via ADB TCP. Automatische Verbindung mit RSA-Key-Authentifizierung.
✂️
Smart Crop
Intelligenter Video-Zuschnitt auf 9:16-Shorts-Format. Automatische Erkennung ob horizontal oder vertikal gecroppt werden muss.
🎵
Audio-Mischung
Hintergrundmusik automatisch hinzufügen. Loop-Funktion für kurze Tracks, Trimming für zu lange Audio-Clips.
⬆️
Auto-Upload
Vollautomatischer Upload-Prozess: YouTube-App öffnen, Shorts-Modus starten, Video auswählen und hochladen.

⚙️ Funktionsweise

1
📋

Konfiguration

JSON-Konfiguration: Quellvideo, Text-Overlay, Musik-Datei und ADB-Verbindungsdaten.

2
✂️

Video-Bearbeitung

moviepy cropt auf 9:16, fügt Text hinzu, mischt Audio und rendert MP4.

3
📱

ADB-Upload

Android-Gerät via ADB: YouTube-App → Shorts-Modus → Video-Auswahl → Upload.

4

Fertig

Short ist online – komplett automatisiert, kein manueller Eingriff nötig.

💻 Quellcode

ADB-Verbindung & Konfiguration

import json, os, time
from adb_shell.adb_device import AdbDeviceTcp
from adb_shell.auth.sign_pythonrsa import PythonRSASigner
import cv2
from moviepy.editor import VideoFileClip, AudioFileClip, \
    TextClip, CompositeVideoClip

class YouTubeShortsCreator:
    def __init__(self, config_path='config.json'):
        self.config = self.load_config(config_path)
        self.device = None
        self.connect_device()

    def load_config(self, config_path):
        with open(config_path, 'r', encoding='utf-8') as f:
            return json.load(f)

    def connect_device(self):
        self.device = AdbDeviceTcp(
            self.config['adb_host'],
            self.config['adb_port']
        )
        self.device.connect(rsa_keys=None, auth_timeout_s=0.1)
        print("Erfolgreich mit Gerät verbunden")

Intelligenter 9:16 Crop

def prepare_video(self):
    video = VideoFileClip(self.config['source_video'])
    target_ratio = 9/16
    current_ratio = video.w / video.h

    if current_ratio > target_ratio:
        # Video ist zu breit → horizontales Cropping
        new_width = int(video.h * target_ratio)
        x_offset = (video.w - new_width) // 2
        video = video.crop(
            x1=x_offset, y1=0,
            x2=x_offset + new_width, y2=video.h)
    else:
        # Video ist zu hoch → vertikales Cropping
        new_height = int(video.w / target_ratio)
        y_offset = (video.h - new_height) // 2
        video = video.crop(
            x1=0, y1=y_offset,
            x2=video.w, y2=y_offset + new_height)

Text-Overlay, Audio-Mix & Rendering

    # Text hinzufügen
    text_clip = TextClip(self.config['text'],
        fontsize=70, color='white',
        stroke_color='black', stroke_width=2)
    text_clip = text_clip.set_position(
        ('center', 'bottom')).set_duration(video.duration)

    # Musik mit Loop/Trim-Logik
    audio = AudioFileClip(self.config['music_file'])
    if audio.duration > video.duration:
        audio = audio.subclip(0, video.duration)
    else:
        audio = audio.loop(duration=video.duration)

    # Rendering
    final_video = CompositeVideoClip([video, text_clip])
    final_video = final_video.set_audio(audio)
    final_video.write_videofile('output_short.mp4',
        codec='libx264', audio_codec='aac')
    return 'output_short.mp4'

Ihre eigene Shorts-Automatisierung?

Ob YouTube-Shorts, TikTok oder Instagram Reels – ich baue Ihre individuelle Content-Automatisierungslösung. Maßgeschneidert, kein Standard-von-der-Stange.

📞 Jetzt anrufen ✉️ E-Mail senden