Posts Tagged ‘video’

Howto: Youtube auto-upload script

March 3, 2010

So you’re making lots of movies and you want things to upload to youtube automatically without you having to do any heavy lifting? If you are comfortable with a little bit of terminal and command line stuff, no problem.

A few things you will need:
Gmail account and Youtube account. These will be linked. You can use one gmail account as the developer for multiple youtube accounts but each youtube account needs it’s own independent email address, and for multiple gmail accounts you might need to get some dummy address at or as an alternative email. Then get yourself a developer key while logged into your developer gmail account.

Python 2.6 is probably already installed. But if not, install that too.

We’ve gotten this working for MacOSX and Linux (ubuntu 9.10 and fedora 11 anyway).
It’s probably not too hard to get it working with Windows but we’ve never tried.

Files you need: at
edit login information for youtube and gmail accounts.
edit developer key. edit the keywords and description to fit your project. at
check the path.
Thanks to Sean Levin for writing these.

Gdata and Atom directories. They are zipped and downloadable here: Unzip and place into same directory as

Copy these files into whatever directory you will be uploading videos from.
You will now need to edit both of these files as noted above. Do you have a favorite text editor for simple code? We like smultron on mac and gedit or emacs on linux but any will do. Whatever music you like.

make sure both files are executable.

chmod 755
chmod 755

then try it out manually. from the video directory prompt try running the videochecker.
yourvideodirectory$ ./
Got Upload directory
You have a save directory
Not running
just before loop start
inside for loop
Uploading OMPD-20100301-20100302.mp4
uploader-log: running doit with the_time=2010-03-02T00:00:53 and the_filename=OMPD-20100301-20100302.mp4
uploader-log: created media_group
uploader-log: created youtube entry
uploader-log: created YouTubeService
uploader-log: attempting to find previous login token in token file
uploader-log: token file found
uploader-log: set login token to DQAAAHUAAA ...
uploader-log: trying login with captcha_token=None and captcha_response=None
uploader-log: login succeeded continuing on to upload
uploader-log: saving token (DQAAAHYAAABXiMigRrgi5 ... ) to token file (youtube_login_token.txt)
uploader-log: starting to upload video entry
uploader-log: completed upload of video entry
uploader-log: OMPD-20100301-20100302.mp4 uploaded to service successfully. Returning success to calling script (0)

if you’re getting an error with videochecker, try changing the first line to
#! /bin/bash -ex and it will output lots of extra info as it runs.

Ok. So you made it that far and now you want to set it up so it runs automatically each day or week or hour. Time for crontab. What is a crontab you ask? It’s sort of like asking your alarm clock to run a program instead of make a loud sound. It’s just a simple text file that you add some instructions to. The only problem is that you usually edit it in vi (a text editor). vi is nice and all but it’s rather confusing if you haven’t used it before. With vi, there are 2 modes, insert-text mode and command mode. 3 most useful key sequences are:
i – enter insert mode,
esc – exit insert mode
ZZ – save file and exit program.
Want to learn more:

In the terminal window (here your current path matters not), enter
crontab -e
type i to put the editor in INSERT mode. (see text in bottom left of editor)

– then make your crontab look like:
# m h dom mon dow command
*/10 * * * * /home/yourlinuxboxname/Videos/Webcam/

(which runs that script every 10 minutes.)

# m h dom mon dow command
* 3 * * * /home/yourmac/Movies/AUTOUPLOAD/

(which runs that script at 3am each evening. But only when the computer is awake.)

– hit the ‘esc’ key to get out of insert mode.

– then type ZZ to save and exit.

Let us know how this works for you and we will try to keep an updated version of these instructions.

installing ffmeg on mac os x

July 27, 2009

i’m on a mac mini. 1.83 intel core duo. 1 gb ram.

os x 10.5.4.

my notes on ffmeg install following this article  —

 tar xvzf lame-3.97.tar.gz

(this line didn’t work for me because mc os x automatically unzipped for me) so instead i need to get rid of the z.

tar xvf lame-3.98-2.tar

then a couple lines down there is a 


this didn’t work for me either. i got

… configure: error: no acceptable C compiler found in $PATH See `config.log’ for more details.

now i’m downloading xcode and developer tools. i’m assuming this will cover the c compiler part.

ok. this block works now. 



sudo make install 


same issue with tar after downloading. i could get the command line download line to work. so i went to download faad from sourceforge. and then used this tar line

tar xvf faad2-2.7.tar

then i ran ./configure, make,and make install.

now back to ffmpeg. mkdir. cd. svn.

“Checked out revision 19521.”

long configure line. make (this is a long one). sudo make install.

now i noticed the additional config flags for the aac stuff. so i go back and run config again.



 ./configure –enable-libmp3lame –enable-shared  –disable-mmx –enable-libfaac –enable-libfaad

libfaad2 is gpl and –enable-gpl is not specified.

If you think configure made a mistake, make sure you are using the latest version from SVN.  If the latest version fails, report the problem to the mailing list or IRC #ffmpeg on Include the log file “config.err” produced by configure as this will help solving the problem.

not sure what this means but i’m moving on…
so here i am. first try.
$ ffmpeg -i codemovie.flv
FFmpeg version SVN-r19521, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: –enable-libmp3lame –enable-shared –disable-mmx
  libavutil     50. 3. 0 / 50. 3. 0
  libavcodec    52.32. 0 / 52.32. 0
  libavformat   52.36. 0 / 52.36. 0
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0. 7. 1 /  0. 7. 1
  built on Jul 27 2009 15:15:19, gcc: 4.0.1 (Apple Inc. build 5493) Unknown format

tar xvf faad2-2.7.tar

it can’t understand the native .mov files written by photobooth. that’s all for now. back to this at a later date.