# convert Celsius to fahrenheit SCRIPT. #
print " type 'stop' to end this app and return to python shell"
print " this app converts celsius to Fahrenheit via loop nesting. "
print " if num line is what makes this app WORK!"
#####
## " this app is python 2point6 uses raw inpute "
#####
stop = 'stop'
###
#c = 33
#f = (reply)*9/5 + 32
#print (c), "degrees (c) celsius " "= " ,(f), "degrees (f) Fahrenheit "
###
# f = (num)*9/5 + 32
while True:
reply = raw_input('Enter your text number now:')
if reply == 'stop':
break
elif not reply.isdigit():
print('Bad!' * 8)
else:
num = int(reply ) *9/5 + 32
if num :
# print('low')
# else:
print(num )
print('Bye')
Sunday, October 30, 2011
python loop 33cels to 91fahr
stupid python 91fahr to 32cels code snippet
run code in console:
$ python ./my-dumb-code.py
##############
cut and paste code:
# python
# fourmula //::: C = (F - 32) * (5 / 9)
# convert fahrenheit to Celsius SCRIPT. #
# darn this lame scrip took me forever to guese #
################
print " type 'stop' to end this app and return to python shell"
print " this app converts Fahrenheit to celsius via loop nesting. "
print " if num is what makes this app WORK!"
#####
## " this app is python 2point6 uses raw inpute "
#####
stop = 'stop'
while True:
reply = raw_input('Type "stop" to exit or 1 to contunue:')
if reply == 'stop':
break
elif not reply.isdigit():
print('Bad!' * 8)
else:
num = int(reply ) ##-32
if num :
f2c = int(raw_input("Please enter the temperature in Fahrenheit you wish to convert: "))
f2c = (f2c - 32) *5/9
# print f
print ">> input converter to cels ="
print f2c
# print('low')
# else:
# print(num )
print('Bye')
python fahrenheit to celsius.
NOTES::
//°C to °F Farenheit = (9/5)* celsius + 32
//°C to °F Multiply by 9, then divide by 5, then add 32
//// °F to °C Deduct 32, then multiply by 5, then divide by 9
// (fahr -32) * (5.0/9.0)
fahrenheit to celsius c++ snippet
it took my slow ass all day to learn this crap.
Saturday, October 29, 2011
Sunday, May 22, 2011
mepis8 ffmpeg x11grab desktop capture
capture fffffffffffffffffffff [bitrate 800]
$ ffmpeg -f oss -ac 2 -i /dev/audio \ -f x11grab -r 25 -s 1024x600 -i :0.0 -b 800 video-n-sound-test_av.mpeg
note:"alsa-oss" may be need to be installed for "/dev/dsp" to work.
------------------
[check] "capture" control on it needs to be used to grab mic sound recording.
mepis8 webcam ffmpeg 5moy2011
mepis8 uname -r 2.6.27!!!
---------------------
mpeg
352x288
/************** ****mepis8 **** *************/
this work with the [ffmpeg -formats] [-f mpeg]
==================
LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so \ ffmpeg -f oss -i /dev/dsp -acodec mp3 -f mpeg -s 352x288 -r 30000/1001 -i /dev/video0 -qmin 4 -qmax 4 -b 500 -aspect 4:3 -f mpeg -r 30000/1001 -y vid-mpeg-ffmpeg-with-mp3sound-q4.mpg
NOTE: "/dev/dsp" can probably be swapped out with [/dev/audio] .
mepis8 is built on debian lenny repos.
Debian's ffmpeg is missing alot of codecs but it works better than MENCODER for av sync web cam recording because mencoder did not keep the audio in sync.
for /dev/dsp to work it may require "alsa-oss.deb" the legacy compliance ap layer is likely needed. "?"
------------------
[check] "capture" control on it needs to be used to grab mic sound recording.
alt.....
NOW ffmpeg-svn
alt.....
Now mepis8 with debiand's 2.6.26 kernel loaded
uname -a
Linux mepis1 2.6.26-2-686 #1 SMP Wed Sep 21 04:35:47 UTC 2011 i686 GNU/Linux
/****************** *** debian / lenny * *******************/##############################
mpeg
================
640x480
================
mepis8 uname -r 2.6.27-***
mepis8 code:
$ LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so \
############
or
debian/lennny
uname -r 2.6.26-2-686
video :large
code lenny:
$ nice -n 19 ffmpeg -f oss -i /dev/dsp -acodec mp3 \ -f video4linux \ -s 640x480 \ -r 30000/1001 \ -i /dev/video0 -qmin 4 -qmax 4 \ -b 500 -aspect 4:3 \ -f mpeg -r 30000/1001 \ vid-[large]-mpeg-ffmpeg-with-mp3sound-q4-large.MPG
video :small
code lenny:
$ nice -n 19 ffmpeg -f oss -i /dev/dsp -acodec mp3 -ac 2 \ -f video4linux \ -s 352x288 \ -r 15000/1001 \ -i /dev/video0 -qmin 4 -qmax 30 \ -b 500 -aspect 4:3 \ -f mpeg -r 20 \ vid-[small]-mpeg-ffmpeg-with-mp3sound-q4-small.mpg
Friday, May 13, 2011
test my ffmpeg webcam vlog script
webcam test script. has auto renaming using the time function.
os: linux Lubuntu11.04 @ 5moy2011 uname -r 2.6.38-8-generic hardware: acer aspire one [aod255e] webcam video driver: video4linux2 audio drivers: alsa for the mic.
#################################### note the low bitrate and frame rate, netbook settings are kind of slow so keep the bitrate, codecs and frame rate low so that the netbook keeps up with ffmpeg. press Q to stop ffmpeg.
#!/bin/bash # # test auto vlog1 [ naming] script and capture byant. ############################## ##ffmpeg -r 15 -b 800k -s 640x400 -f video4linux2 -i /dev/video0 \ ## -vcodec msmpeg4v2 -f alsa -ac 2 -vol 512 -i hw:0,0 vlog111div3-vol512_alsa.avi ## ############################### DIR=/home/"user"/vlog ffmpeg -r 15 -b 800k -s 640x400 -f video4linux2 -i /dev/video0 \ -vcodec msmpeg4v2 -f alsa -ac 2 -vol 512 -i hw:0,0 vv1temp-out-lowercase.avi && sleep 2 for old in `ls ~/vlog/*.avi` ; do today=~/vlog/`date +%F+Hour%H+Min%M+Sec%S`.AVI ; mv $old $today; done
lubuntu mods below. ########################################## sound works , video works , wifi and lan work. not bad for a 200$ netbook from walmart.
lsmod Module Size Used by cryptd 19801 0 aes_i586 16956 3 aes_generic 38023 1 aes_i586 parport_pc 32111 0 ppdev 12849 0 snd_hda_codec_realtek 255820 1 joydev 17322 0 snd_hda_intel 24140 6 snd_hda_codec 90901 2 snd_hda_codec_realtek,snd_hda_intel snd_hwdep 13274 1 snd_hda_codec snd_pcm 80244 4 snd_hda_intel,snd_hda_codec snd_seq_midi 13132 0 arc4 12473 2 snd_rawmidi 25269 1 snd_seq_midi snd_seq_midi_event 14475 1 snd_seq_midi i915 450944 2 snd_seq 51291 2 snd_seq_midi,snd_seq_midi_event brcm80211 690428 0 snd_timer 28659 4 snd_pcm,snd_seq snd_seq_device 14110 3 snd_seq_midi,snd_rawmidi,snd_seq sparse_keymap 13666 0 mac80211 257001 1 brcm80211 uvcvideo 66851 0 drm_kms_helper 40745 1 i915 cfg80211 156212 2 brcm80211,mac80211 videodev 75143 1 uvcvideo psmouse 73312 0 drm 180037 3 i915,drm_kms_helper snd 55295 17 snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device serio_raw 12990 0 soundcore 12600 1 snd snd_page_alloc 14073 2 snd_hda_intel,snd_pcm i2c_algo_bit 13184 1 i915 video 18951 1 i915 lp 13349 0 parport 36746 3 parport_pc,ppdev,lp usbhid 41704 0 hid 77084 1 usbhid ahci 21591 2 libahci 25548 1 ahci atl1c 36237 0 #########################################/********************** *** debian lenny old ** *********************/ and now for debian lenny mepis8/debian/lenny
debian lenny webcam scrypt. uname -r 2.6.26
#!/bin/bash # # test auto vlog1 [ naming] script and capture byant. ############################## ## lubuntu settingd BAK# ##ffmpeg -r 15 -b 800k -s 640x400 -f video4linux2 -i /dev/video0 \ ## -vcodec msmpeg4v2 -f alsa -ac 2 -vol 512 -i hw:0,0 vlog111div3-vol512_alsa.avi ## ############################### DIR=/home/"user name"/vlog1 nice -n 19 ./ffmpeg-svn -f oss -i /dev/dsp -acodec mp3 -ac 2 -vol 512 \ -f video4linux -s 640x480 -r 30000/1001 -i /dev/video0 \ -f avi -vcodec msmpeg4 -qmin 4 -qmax 7 -b 800 \ vv1temp-out-lowercase.avi && sleep 2 for old in `ls ~/vlog1/*.avi` ; do today=~/vlog1/`date +%F+Hour%H+Min%M+Sec%S`.AVI ; mv $old $today; doneok.