Da ich nicht weiß, wie lange das Script online sein wird, habe ich es hier noch einmal veröffentlicht:
# makevid.py - Make videos from a single image plus a sound file
# Copyright (C) 2007 Sam Peterson
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
makevid.py by Sam Peterson
Latest version of script should be available at:
This script creates an avi divx video for uploading to YouTube given
only an mp3 and an image file. I use it to create video reponses to
people on YouTube. I have a microphone, but I currently don't have a
working video device. Plus, if I did, I wouldn't use it anyway, as I
don't like to place my face in public Internet forums. The script
requires a working mencoder in your PATH.
This script takes three command line arguments: a path to an image
file, a path to an audio file, and a number of seconds. If everything
goes smoothly, a video file named output.avi will be written to the
current directory. The file should play roughly as long as the number
of seconds specified.
makevid.py lebowski.jpg audio.mp3 20
Please email any bugs to email@example.com. The videos seems to
work well once uploaded, but seeking seems a little strange. I'm open
to all suggestions.
* You should pre-scale your image file to 320x240, which is the YouTube
* To my knowledge, the audiofile doesn't have to be an mp3, but that's
the recommended format on YouTube's website.
TODO: I think it should be possible to determine how long the video
needs to be from the audio file, but I'm not sure of the best way to
do this. If it could be done it would eliminate the requirement of
manually passing the number of seconds to the script.
import os, sys
fps = 30
if len(sys.argv) != 4:
print "Usage: makevid.py audiofile imagefile seconds"
secs = int(sys.argv)
if secs < secs =" 1" filesexist =" True" filesexist =" False" mencoder_cmd =" ('mencoder" fps="%f" vbitrate="100">
Anleitung für das Skript unter Ubuntu:
- In die Konsole wechseln und mit
sudo apt-get install mencoder„mencoder“ installieren.
- Skript kopieren, in eine Textdatei einfügen und unter „makevid.py" speichern.
- In das Verzeichnis, in dem das Skript liegt, mit
- Diese Textdatei mit
chmod +xausführbar machen.
- Ein Video mit
makevid.py Bild.jpg Audio.mp3 Sekundenerstellen.