Tuesday, April 22, 2014

omxplayer

OMXPlayer

OMXPlayer is a commandline OMX player for the Raspberry Pi. It was developed as a testbed for the XBMC Raspberry PI implementation and is quite handy to use standalone.

Downloading OMXPlayer

git clone git://github.com/huceke/omxplayer.git

Compiling OMXPlayer

GCC version 4.7 is required.

Cross Compiling

You need the content of your sdcard somewhere mounted or copied. There might be development headers to install on the running Pi system for the crosscompiling.
Edit Makefile.include and change the settings according your locations.
make ffmpeg
make
make dist

Installing OMXPlayer

Copy over omxplayer-dist/* to the Pi /. You may want to specify a valid font path inside the omxplayer shell script.

Compiling on the Pi

You can also compile it on the PI the native way ;) Run this script (which will install packages and update firmware) ./prepare-native-raspbian.sh and build with make ffmpeg make

Using OMXPlayer

Usage: omxplayer [OPTIONS] [FILE]
Options :
         -h / --help                    print this help
         -n / --aidx  index             audio stream index    : e.g. 1
         -o / --adev  device            audio out device      : e.g. hdmi/local
         -i / --info                    dump stream format and exit
         -s / --stats                   pts and buffer stats
         -p / --passthrough             audio passthrough
         -d / --deinterlace             deinterlacing
         -w / --hw                      hw audio decoding
         -3 / --3d mode                 switch tv into 3d mode (e.g. SBS/TB)
         -y / --hdmiclocksync           adjust display refresh rate to match video (default)
         -z / --nohdmiclocksync         do not adjust display refresh rate to match video
         -t / --sid index               show subtitle with index
         -r / --refresh                 adjust framerate/resolution to video
         -g / --genlog                  generate log file
         -l / --pos n                   start position (in seconds)
              --boost-on-downmix        boost volume when downmixing
              --vol n                   Set initial volume in millibels (default 0)
              --subtitles path          external subtitles in UTF-8 srt format
              --font path               subtitle font
                                        (default: /usr/share/fonts/truetype/freefont/FreeSans.ttf)
              --font-size size          font size as thousandths of screen height
                                        (default: 55)
              --align left/center       subtitle alignment (default: left)
              --lines n                 number of lines to accommodate in the subtitle buffer
                                        (default: 3)
              --win "x1 y1 x2 y2"       Set position of video window
              --audio_fifo  n           Size of audio output fifo in seconds
              --video_fifo  n           Size of video output fifo in MB
              --audio_queue n           Size of audio input queue in MB
              --video_queue n           Size of video input queue in MB
For example:
./omxplayer -p -o hdmi test.mkv

Key Bindings

While playing you can use the following keys to control omxplayer:
z           Show Info
1           Decrease Speed
2           Increase Speed
j           Previous Audio stream
k           Next Audio stream
i           Previous Chapter
o           Next Chapter
n           Previous Subtitle stream
m           Next Subtitle stream
s           Toggle subtitles
d           Subtitle delay -250 ms
f           Subtitle delay +250 ms
q           Exit OMXPlayer
Space or p  Pause/Resume
-           Decrease Volume
+           Increase Volume
Left Arrow  Seek -30 s
Right Arrow Seek +30 s
Down Arrow  Seek -600 s
Up Arrow    Seek +600 s

if ,elif and else statements from the python

this is the simple program take the inputs from the user and process the output using the if elif and else

 x = int(raw_input("Please enter an integer: "))
Please enter an integer: 42
>>> if x < 0:
     x = 0
     print 'Negative changed to zero'
elif x == 0:
print 'Zero'
elif x == 1:
     print 'Single'
else:
print 'More'
More


//to write in file
//for raspberry pi
sudo nano filename.py
//for beagle bone black
nano filename.py


//for compiling the code
//on raspberry pi
sudo python filename.py
//on beagle
python filename.py



Running shell commands from the python on raspberry pi and beaglebone black

//displaying the date command

import os
os.system("date")


//taking the input from the your and processing that using the python

import os
os.system("date")
user_input = input('Give me a number: ')
if user_input==1 :
os.system("omxplayer -o hdmi /home/pi/videos/Kommalallo.mp4")
elif user_input==2 :
os.system("omxplayer -o hdmi /home/pi/videos/Poovai.flv")
elif user_input==3 :
os.system("omxplayer -o hdmi /home/pi/videos/RamChahe.mp4")
elif user_input==4 :
os.system("omxplayer -o hdmi /home/pi/videos/Sasirekha.mp4")
elif user_input==5 :
os.system("omxplayer -o hdmi /home/pi/videos/Kommalallo.mp4")
else:
os.system("ctrl+c")




Monday, April 21, 2014

Using Youtube on the Raspberry Pi without XBMC or gnash




You can install this by pulling the source from git and running the InstallAUISuite.sh file.
Commands to install are below (your user should have sudo priveledges but you don't need to sudo or be root to run the commands unless shown otherwise):

sudo apt-get install git-core
git clone git://github.com/StevenHickson/PiAUISuite.git
cd PiAUISuite/Install/
./InstallAUISuite.sh

Update Instructions 

cd PiAUISuite
git pull
cd Install
sudo ./UpdateAUISuite.sh



So this is a quick video to demonstrate youtube working fast and easily on the Raspberry Pi without the use of XBMC or gnash.
I tried out gnash first which didn't work at all.
So then I tried out XBMC and although it is pretty, it is awfully slow so I decided to get youtube to work on my own.
The basis of this is really simple. There is a nifty program out there called youtube-dl that can get the media file from the website and download it. It's great because it does it fast and works for many other websites like the daily show and the colbert report.
So what I did was basically write a little script that analyzes your input and then gets the proper information from the youtube-dl program without downloading the video, then it sends this http stream to omxplayer to play.
It can handle playlists or individual files from multiple websites as well as a bunch of other things.

After that, I started implementing a nice little search feature using C++ and Curl.
I'm starting to implement a GUI which will essentially look like youtube kind of. Until then I have this nifty search tool, which was essentially my start to the GUI I am currently creating.

If you've ever used XBMC's youtube, you will notice that this is a lot faster, and in my opinion, easier to use and more natural. Plus it only requires a tiny file on your system as opposed to XBMC's massive footprint.

related websites:
http://rg3.github.io/youtube-dl/

Sunday, April 20, 2014

up comming development boards

http://www.arndaleboard.org/wiki/index.php/Main_Page

intel galileo

Friday, April 18, 2014

configuration file for the raspberry pi getting HDMI display


# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
overscan_left=20
overscan_right=20
overscan_top=20
overscan_bottom=20

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# for more options see http://elinux.org/RPi_config.txt

Sunday, April 13, 2014

REED switch with arduino

This is the tutorial explains about how to connect the reed switch with arduino
the simple program for the reed switch

//Turn on LED while reed switch is closed

#define LED 13     //pin for the LED
#define SWITCH 7   //input for REED SWITCH

int val = 0;       //used to store input value

void setup() {
  pinMode(LED, OUTPUT);   //tell arduino LED is an output
  pinMode(SWITCH, INPUT);   //SWITCH is input
}

void loop(){
  val=digitalRead(SWITCH);   //read input value and store it
 
  //check whether input is HIGH (switch closed)
  if (val==HIGH) {
    digitalWrite(LED, HIGH);   //turn LED on
  } else{
    digitalWrite(LED, LOW);
  }
}
pls check the video how the reed switch will work


 

Saturday, April 12, 2014

LED blink code for raspberry pi

  1. import RPi.GPIO as GPIO  
  2. import time  
  3. # blinking function  
  4. def blink(pin):  
  5.         GPIO.output(pin,GPIO.HIGH)  
  6.         time.sleep(1)  
  7.         GPIO.output(pin,GPIO.LOW)  
  8.         time.sleep(1)  
  9.         return  
  10. # to use Raspberry Pi board pin numbers  
  11. GPIO.setmode(GPIO.BOARD)  
  12. # set up GPIO output channel  
  13. GPIO.setup(11, GPIO.OUT)  
  14. # blink GPIO17 50 times  
  15. for i in range(0,50):  
  16.         blink(11)  
  17. GPIO.cleanup()  

Tuesday, April 8, 2014

CHECK YOUR PREPAID BALANCE



VODAPHONE
Dial *141#,*145#  and press OK to check your balance on Vadaphone Prepaid

AIRTEL
To Check your Balance in Airtel, Dial *123# from your Airtel Mobile.

RELIANCE GSM
Dial *367# From Your Reliance Mobile to Check Account Balance.

RELIANCE CDMA
Dail *225 You will receive an sms with your balance and validity.

TATA DOCOMO
To Know Account Balance information dial *111# from your Tata Docomo Mobile.
AIRCEL
To Check your Balance in Aircel, Dial *123# ,*125# from your Aircel Mobile.

IDEA
To Check Account Balance in your Idea Mobile Dial *212# from Your Idea Mobile.

BSNL
Check Balance Dial *123# from your BSNL Prepaid Mobile.

UNINOR
Check Balance Dial *222*2# from your UNINOR Prepaid Mobile.
Very Good For International Calling.

Tuesday, April 1, 2014

ubuntu on beagle bone black using putty

This is the tutorial explains about the how to connect the beagle bone black with ubuntu operating system and how to get the LXDE environment on the putty terminal.
 

python class topic video