Attempt to use openshot to create video (failed)
Anyway, install openshot. Openshot got upset with my Lucid installation codecs when I attempted export; claiming libx264 was not installed. Some reading: there are two versions, one closed, one open. I most likely have the open version which is limited.$ sudo apt-get install libavcodec-extra-52 libavdevice-extra-52 libavfilter-extra-0 libavformat-extra-52 libavutil-extra-49 libpostproc-extra-51 libswscale-extra-0
Then openshot hangs on export.
Attempt command line encoding with libav-tools (fail to install on Lucid)
Try command line: I need the libav-tools package, not present in Lucid. Add a personal package providing it:
$ sudo add-apt-repository ppa:kxstudio-team/ppa
$ sudo apt-get update
Still can't install it! Manually add,
deb http://ppa.launchpad.net/kxstudio-team/ppa/ubuntu lucid main
deb-src http://ppa.launchpad.net/kxstudio-team/ppa/ubuntu lucid main
to /etc/apt/sources.list and update: $ sudo apt-get update
Still no joy. Looks like I need to update my installation.
Workaround:
Attempt command line encoding with ffmpeg (Seg fault)
Older linux: create movie from images with ffmpeg:
$ ffmpeg -qscale 5 -r 20 -b 9600 -i v9_j58_anim???.png v9_j58.mp4
FFmpeg version SVN-r0.5.9-4:0.5.9-0ubuntu0.10.04.3, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --extra-version=4:0.5.9-0ubuntu0.10.04.3 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 1 / 52.20. 1
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libavfilter 0. 4. 0 / 0. 4. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Jan 24 2013 19:42:59, gcc: 4.4.3
Input #0, image2, from 'v9_j58_anim000.png':
Duration: 00:00:00.05, start: 0.000000, bitrate: N/A
Stream #0.0: Video: png, rgb24, 1276x934, 20 tbr, 20 tbn, 20 tbc
Segmentation fault
Pity. Gave up here.#
Attempt with avconv (not in Lucid)
avconv looks simpler and is available on newer Ubuntus. Try,
$ avconv -i *.png movie.mp4
or don't in Lucid: it's not available.
Attempt with openmovieeditor
$ sudo apt-get install openmovieeditor
So far so good. Navigate to the directory containing nothing but images and click render.
Result: a non-zeros file, that displays a black mplayer screen. That's a morning lost.
Attempt with gifsicle
I used to use this during the PhD. It needs gif images so convert all these pngs to gifAttempt with recordmydesktop
$ sudo apt-get install recordmydesktop
$ recordmydesktop -x 500 -y 250 --width 800 --height 700 --no-sound --delay 10 output.ogv
A good start. Capture works and mplayer plays the output. Now to crop.
Best approach (using xdotool, xmacrorec, screengran, python PIL and GIMP)
recordmydesktop worked but had a habit of leaving a white square on the desktop after closing, and
dropped some frames; and the result didn't look so good. A better approach might be to write a macro
to iterate through the animation frames, saving them. Crop the result in python and create the animation in GIMP.
Luckily, PafVu will save animations as a series of .png files, leaving only the cropping and creation of the animation.
If a frequency based animation is needed, use the other tools to create a macro to step through the displaced shapes.
imageRoot = '/home/me/screenshots/animSource/'
imageTarget1 = '/home/me/screenshots/animCroppedSolid/'
imageTarget2 = '/home/me/screenshots/animCroppedTrans/'
fontpath = '/usr/share/fonts/truetype/ubuntu-font-family-0.80/' # system specific!
a = os.listdir(imageRoot)
a = [i for i in a]
f = reference.logscale(1, 1000, 192)
# It seems that PIL will not load normal fonts like those given away
# by Ubuntu, or those on the system already. That's damn annoying.
# Seems they have thier own format: pbm or .pil but I cannot find them.
# No: truetype fonts do work but the command for use is truetype specific.
font = ImageFont.truetype(fontpath + 'Ubuntu-B.ttf', size=16) # true type
#font = ImageFont.load(fontpath + 'Ubuntu-B.ttf') # true type
# font = ImageFont.truetype("arial.ttf", 15) # truetype
ii = 0
imageTarget = imageTarget1
for i in sorted(a):
print i, ii, f[int(ii/2)]
b = Image.open(imageRoot + i)
c = b.crop((740, 345, 1580, 880)) # use this when happy freqs are correct.
# c = b # use this to check f[ii/2] = f
draw = ImageDraw.Draw(c)
# draw.line((0,0) + c.size, fill=128) # an example.
draw.text([300, 10], 'Frequency: %.2f Hz' % f[int(ii/2)], fill=128, font=font)
del(draw)
c.save(imageTarget + i + '.new.png')
if imageTarget == imageTarget1:
imageTarget = imageTarget2
else:
imageTarget = imageTarget1
ii += 1
No comments:
Post a Comment