I have a bunch of mpg's (extention avi) from my cannon digital elph which I would like to combine to make one giant flv suitable for web viewing.
This was a good start: http://ffmpeg.mplayerhq.hu/faq.html#TOC29
but in the end, it became as simple as doing the following
cat *.AVI > bigcahuna.mpg
ffmpeg -i bigcahuna.mpg -f flv -s 640x480 priderock.flv
That's it!
for more possibly relevant material, see: http://del.icio.us/gdw/flv
Thursday, May 08, 2008
Thursday, April 24, 2008
Temporarily Share Internet Connection on Ubunty Gutsy (Linux)
On host machine:
(this machine has wireless internet connection over wlan0 and wants to share it over eth0)
sudo ifconfig eth0 192.168.10.1 netmask 255.255.255.0
sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
sudo su
echo 1 > /proc/sys/net/ipv4/ip_forward
On client machine:
(this machine wants to connect to host over eth0)
sudo ifconfig eth0 192.168.10.2
sudo route add default gw 192.168.10.1 eth0
Source: http://wiki.steenbe.nl/?p=29#more-29
(this machine has wireless internet connection over wlan0 and wants to share it over eth0)
sudo ifconfig eth0 192.168.10.1 netmask 255.255.255.0
sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
sudo su
echo 1 > /proc/sys/net/ipv4/ip_forward
On client machine:
(this machine wants to connect to host over eth0)
sudo ifconfig eth0 192.168.10.2
sudo route add default gw 192.168.10.1 eth0
Source: http://wiki.steenbe.nl/?p=29#more-29
Wednesday, April 09, 2008
Save interactive python history to file
import readline
readline.write_history_file('lds_calendar.py')
readline.write_history_file('lds_calendar.py')
Tuesday, April 01, 2008
Batch croping images in Linux
I used this blog post: http://www.kriyayoga.com/love_blog/post.php/853
I was having a hard time with the for loop because of spaces in my file names. I tried this alternative and it worked. I'm not sure that I couldn't have gotten the for loop to work though, had I added the proper quotes.
find ./ -name '* *' | while read FILE; do convert "$FILE" -crop 487x370+386+281 "$FILE-cropped.jpg"; done
487x370 are the new image sizes. 386 and 281 are the offsets from the left and top borders.
I was having a hard time with the for loop because of spaces in my file names. I tried this alternative and it worked. I'm not sure that I couldn't have gotten the for loop to work though, had I added the proper quotes.
find ./ -name '* *' | while read FILE; do convert "$FILE" -crop 487x370+386+281 "$FILE-cropped.jpg"; done
487x370 are the new image sizes. 386 and 281 are the offsets from the left and top borders.
Wednesday, March 12, 2008
Red, Green, White LEDs
Our original circuit design used a dual-colored LED (red/green) as an idicator to signal the crossover of a voltage on the comparitor (if that makes any sense). The problem, as seen in the graph below, was that for a given voltage, the currents across the different colors varied significantly. This caused a problem in that when the red/green LED switched colors, it would cause the white LED on the end of the shaft to dim or go brighter. For obvious reasons, this is not good. We need a constant light source.

So I decided to use two discrete LEDs in hopes that I could put different resistor values in series with each of them, thus providing equal current drain.
This last week we got the LEDs and I built the circuit and it works. Previous current drains were up in the ~20mA (for green) and ~30mA (for red). Now it's closer to 6mA for both colors.
Just a note: The opamp swings different amounts in both directions. I don't know if this is a problem or what exactly is causing it. My guess would be that the resistor values on the voltage dividers aren't exactly equal, resulting in the power supplies being skewed.
So I hooked the two leds up (separately) to a variable resistor, set the resistor value to yield an appropriate3 intensity and current measurement, and then measured the variable resistor to figure out what value of discrete resistor I should use to yield the desired results.
Red: ~8k
Green: ~3.3k
Using these values, like alluded to above, I measure the current drain of the entire circuit and found it to be very stable.
---
Now a note about white LEDs. The white LEDs we have are super bright and they only draw 1-2mA (compared to ~3mA for the red and green ones). It makes me wonder if we should (can) use a coupled of white LEDs with cheap filters over them (think red cellophane) instead of the colored ones.

So I decided to use two discrete LEDs in hopes that I could put different resistor values in series with each of them, thus providing equal current drain.
This last week we got the LEDs and I built the circuit and it works. Previous current drains were up in the ~20mA (for green) and ~30mA (for red). Now it's closer to 6mA for both colors.
Just a note: The opamp swings different amounts in both directions. I don't know if this is a problem or what exactly is causing it. My guess would be that the resistor values on the voltage dividers aren't exactly equal, resulting in the power supplies being skewed.
So I hooked the two leds up (separately) to a variable resistor, set the resistor value to yield an appropriate3 intensity and current measurement, and then measured the variable resistor to figure out what value of discrete resistor I should use to yield the desired results.
Red: ~8k
Green: ~3.3k
Using these values, like alluded to above, I measure the current drain of the entire circuit and found it to be very stable.
---
Now a note about white LEDs. The white LEDs we have are super bright and they only draw 1-2mA (compared to ~3mA for the red and green ones). It makes me wonder if we should (can) use a coupled of white LEDs with cheap filters over them (think red cellophane) instead of the colored ones.
Thursday, March 06, 2008
Django on Ubuntu Gutsy
My first steps at Django
sudo apt-get install libapache2-mod-python python-django
sudo apt-get install mysql-server python-mysqldb
sudo /etc/init.d/mysql start (the previous line upgraded mysql and didn't restart it)
cd /home/username_here
django-admin startproject mysite
cd mysite
./manage.py runserver
[I opened up a putty session forwarding my localport 7145 over to localhost:8000 on the ubuntu box]
in firefox: http://localhost:7145
sudo apt-get install libapache2-mod-python python-django
sudo apt-get install mysql-server python-mysqldb
sudo /etc/init.d/mysql start (the previous line upgraded mysql and didn't restart it)
cd /home/username_here
django-admin startproject mysite
cd mysite
./manage.py runserver
[I opened up a putty session forwarding my localport 7145 over to localhost:8000 on the ubuntu box]
in firefox: http://localhost:7145
Wednesday, March 05, 2008
Simulations
For my ME Capstone course, I'm building a distance sensing circuit which will throw a dual colored LED on way or the other depending on which site of a distance threshold the tip of the device is at.
Currently, we have a potentiometer to calibrate the device in one location and we're thinking of moving to another location with the hopes of making the device 'totally calibratable'. This is in an effort to compensate for variances in photoresistor performance.

So, I'm going to run a parametric sweep simulation to show my how the device switches for the configuration we have now, and then I will run the same simulation, moving the pot as shown above.
Here are the results from my first simulation.
Currently, we have a potentiometer to calibrate the device in one location and we're thinking of moving to another location with the hopes of making the device 'totally calibratable'. This is in an effort to compensate for variances in photoresistor performance.
So, I'm going to run a parametric sweep simulation to show my how the device switches for the configuration we have now, and then I will run the same simulation, moving the pot as shown above.
Here are the results from my first simulation.
Subscribe to:
Posts (Atom)