Archive

Posts Tagged ‘python’

You-Get – Video Download Script for YouTube, YouKu, DailyMotion, and More

April 22nd, 2013 8 comments

youku_logoYouKu is the equivalent of YouTube in China, and earlier today I wanted to download a video from the service, so I’ve looked for an application or script that can do the job in Linux. I’ve finally come across you-get, a python 3 script that claims to be able to download videos from an impressive number of websites, namely:

YouTube
Vimeo
Coursera
Blip
Dailymotion
Facebook
Google+
Google Drive
Tumblr
Vine
SoundCloud
Mixcloud
Freesound
JPopsuki
VID48
Niconico (ニコニコ動画)
Youku (优酷)
Tudou (土豆)
YinYueTai (音悦台)
AcFun
bilibili
CNTV (中国网络电视台)
Douban (豆瓣)
ifeng (凤凰视频)
iQIYI (爱奇艺)
Joy.cn (激动网)
Ku6 (酷6网)
MioMio h
NetEase (网易视频) (v.163.com)
PPTV.com
QQ (腾讯视频) (v.qq.com)
Sina (新浪视频) (video.sina.com.cn)
Sohu (搜狐视频) (tv.sohu.com)
56 (56网)
Xiami (虾米)
Baidu (百度音乐) (music.baidu.com)
SongTaste

I won’t try all, but just test it with YouKu and YouTube. First things first, let’s install it:

git clone git://github.com/soimort/you-get.git
cd you-get
sudo apt-get install python3 python3-setuptools
./you-get -V
make install

Time to go to youku.com and download a video:

you-get http://v.youku.com/v_show/id_XNTQ1OTk3NTAw.html
Video Site: Youku.com
Title:      1 second boot QT app in linux-sunxi with  A10
Type:       Flash video (video/x-flv)
Size:       5.45 MB (5711001 Bytes)

Downloading 1 second boot QT app in linux-sunxi with  A10.flv ...
100.0% (  5.4/5.4  MB) [========================================] 1/1

Success! And now Youtube:

you-get https://www.youtube.com/watch?v=A-9NKWm748o
 Video Site: YouTube.com
 Title:      Sigma Designs Digital Signage Demo - Frame Layout
 Type:       Flash video (video/x-flv)
 Size:       1.14 MB (1196352 Bytes)
Downloading Sigma Designs Digital Signage Demo - Frame Layout.flv ...
 100.0% (  1.1/1.1  MB) [========================================] 1/1

All good, and that was easy. To download several videos, you can either write you own script, or add videos in you-get command line such as “you-get link2video1 link2video2 … link2videon“.

I remember somebody on G+ wanted to upload several videos to YouKu, so while I was on this subject, I decided to have a look at YouKu upload scripts as well.

There is indeed a script called “pyYouku“, which is also written in Python, that allows you to upload videos to YouKu. Once you download the software, you just need to update config.py with your username, password, and partner ID (API key). The latter is quite problematic, as you have to apply to become a developer (easy), and then request an API key by sending YouKu an email with your business name & address, business phone and business license (hard). And this is where I gave up…

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

Replicate CAPE Adds 3D Printring Capability to the Beaglebone

February 2nd, 2013 No comments

Beagleboard.org launched the Beaglebone Cape Design Contest back in November, several designs were submitted, and yesterday, they announced the 3 winning CAPEs who will be manufactured and sold by Circuitco Electronics:

  • Replicape by Elias Bakken - 3D printer cape
  • Interacto by Chris Clark – Cape with a triple axis accelerometer,a gyroscope, a magnetometer and a 640×480 30fps camera.
  • Geiger cape by Matt Ranostay – Geiger counter cape

Since today I’ve started to write about 3D printing, let’s carry on and have a closer look at the Replicape.

Replicape

The Replicape 3D printer cape includes:

  • 5 stepper motors (X, Y, Z, Ext1, Ext2)
  • 3 high power MOSFETs (PWM controlled) for 2 extruders and 1 HPB
  • 3 medium power MOSFETs (PWM controlled) for up to 3 fans
  • 3 analog input ports for thermistors
  • 3 inputs for end stops (X, Y, Z)
  • Programmable current limits on steppers motor drivers (SMD). No need to manually adjust a pot meter.
  • Microstepping individually programmable for each SMD from 1 to 32.
  • X, Y and Ext 1 SMDs wired to PRUICSS for hard real time operation.
  • Option for stackable LCD cape

It seems to be working, albeit slowly, as a control board for the Makerbot Cupcake.

The replicate hardware files (schematics, bill of materials, gerber files), and the source code (Python and C) for the PRU and controlling stepper motors, are available on Bitbucket. So you could make it yourself, or buy the Replicate from Circuitco when it’s available, and improve the source.

You can also follow Elias progress on his blog: hipstercircuits.com.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

Beaglebone: The Perfect Telemetry Platform? – ELCE 2012

January 15th, 2013 No comments

Matt Ranostay, technical staff at Ranostay Industries, gives a presentation about a telemetry system based on Beaglebone at the Embedded Linux Conference Europe on November 5, 2012.

Abstract:

The author will discuss his ongoing and other team members efforts to develop hardware and software that reports sensor data to the community. This talk will be split into several parts a) types of useful sensors b) hardware design of Beaglebone capes c) and telemetry reports to Pachube/Cosm. Demonstrating that in the new world of cheap prototyping boards with I2C, GPIO, and SPI that anyone can setup a decent monitoring system for home security, automation, and weather reporting. There will be a live demo of prototype geiger counter + weather station.

The audience targeted is the professional hobbyist who likes to hack on microcontrollers in their spare time. It will take little to medium knowledge of electrical engineering to follow this talk.

Telemetry System (Weather Station + Geiger Counter) Block Diagram

Telemetry System (Weather Station + Geiger Counter) Block Diagram

You can download the slides for this presentation, and demo source (Python) is available on Github. There are also many other references at the end of the presentation slides.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

3.95 Euros RPI-UEXT Breadboard & UEXT Adapter for Raspberry Pi is Now Available

December 19th, 2012 No comments

Last month, I wrote about an upcoming T-shaped adapter for the Raspberry Pi that can easily plug  into a breadboard, and provides a UEXT connector that can bring new features (RTC, GPRS, sensors, relays…) to the Raspberry Pi via low cost external UEXT modules. Olimex has just announced the RPI-UEXT adapter is now available for 3.95 Euros.

RPI-UEXT Adapter Plugged into a Breadboard

To connect RPI-UEXT adapter to the Raspberry Pi, you’ll need to purchase a 26-pin ribbon cable and a breadboard if you don’t have these already. Olimex provides those 2 for respectively 2 & 2.95 Euros. That means a complete set would cost 8.90 Euros.

As discussed on my first RPI-UEXT post, what makes this little board really interesting are all the existing UEXT modules (over 20) that bring new features at very low cost. Olimex uploaded a video showing the Raspberry Pi, the RPI-UEXT and the MOD-IO UEXT module connected together, with the Raspberry Pi controlling the 4 relays on MOD-IO.

The Linux instructions and Python source code to control those 4 relays from the Raspberry Pi are available on Olimex Blog. As usual with Olimex, the board is open source, and you can download the schematics and PCB layout in Eagle format or PDF (schematics only). For now, the board can only be purchased directly on Olimex website, but should eventually be available through distributors.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

libavg on Raspberry Pi

December 17th, 2012 No comments

libavg development team has recently announced a beta port of their multimedia library to the Raspberry Pi. libavg is a high-level development platform for media-centric applications using Python as scripting language and written in C++. I came to know this platform as I tried Xibo Digital Signage, and I tested it on ARM platforms.

Up to know this would only work using software rendering/decoding, and everything was painfully slow on ARM, but libavg developers are now making use of OpenGL ES to boost graphics speed. More work is needed, and they intend to eventually support features such as hardware video decoding (OpenMAX possibly via gstreamer) and compressed textures.

Installing libavg on Raspberry Pi.

Pre-built packages are available for Raspberry, so installation is pretty straight forward:

sudo apt-get install libxml2 libpango1.0-0 librsvg2-2 libgdk-pixbuf2.0-0 \
  libavcodec53 libavformat53 libswscale2 libboost-python1.49.0 \
  libboost-thread1.49.0 libsdl1.2debian libxxf86vm1
wget https://www.libavg.de/site/attachments/download/190 -O libavg-raspberry.tar.bz2
sudo tar -C /usr/local -xjf libavg-raspberry.tar.bz2

Running Samples Apps

32 samples are located in /usr/local/lib/python2.7/dist-packages/libavg/samples/ directory, and they rely on X11, so first start LXDE:

startx

Open a serial console (LXTerminal) and run one of the sample:

cd /usr/local/lib/python2.7/dist-packages/libavg/samples/
python sampleapp.py

This will show a smoothly spinning “Hello World” string. Press “esc” to stop the demo. Most of them seems to work including software video playback (small video with low resolution and 29 frames). However, the first time, I tried with composite video output, and the content is not properly centered in the window, most probably because of overscan compensation is enabled. Most applications are just used to test libavg functionalities, although they could be also used as “getting started” tutorials, but firebird, a python/libavg game, is a lot of more fun to play with. It will require 1280×720 (720p) resolution, so it won’t work with composite, and if you use 720p, you may also have to enable disable_overscan=1 in config.txt, located in the FAT partition of your SD card.

cd firebirds
python firebirds.py

Firebirds

The game is generally smooth, but the audio may cut from time to time. Changes in libavg config file (avgrc) may improve it.

If you want to use the latest version of libavg (svn head), you’ll have to built it yourself using a chroot as shown on libavg Raspberry Pi page, and preferably a powerful build machine since libavg is currently cross-compiled via qemu.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

Xibo Digital Signage Version 1.4.0 Released

October 29th, 2012 No comments

Xibo has just announced the release of Xibo 1.4.0 (codename: “Brorsen”). Contrary to version 1.3.0 which was a development release, Xibo 1.4.0 is a stable release and you should consider updating your current installations if you want to take advantage of some of the 27 new features and/or 108 bug fixes. This version replaces the previous stable version (1.2.2) released 18 months ago.

If you are not familiar with Xibo, it is an open source Client/Server digital signage framework that can run in Windows (.NET implementation) and Linux (Client: Python, Server: LAMP). For some more details, you can read my introduction to Xibo and/or a “getting started” tutorial I wrote some time ago.

Main new features in Xibo 1.4.0

  • Significant improvements to permissions – View, Edit and Delete permissions can now be set on the following items:
    • Library Media
    • Layouts
    • Regions in Layouts
    • Media on Region Timelines
    • DataSets
    • Display Groups
    • Displays
  • A new timeline editing window – Improvements have been made to:
    • Make the region time line more consistent
    • Simplify re-ordering the items in the timeline
    • Make it easier to add new items from the library
    • To make the region preview reflect the client more closely
  • .NET Client Improvements:

    • Reduced “lag” and “display jitter” when the client is connecting to the Server
    • Concurrent file downloads
    • Clearing up old and unused files in the library
    • Information window showing client status, library status and log information
    • Replacing the splash screen
  • Features for service providers – Ability to set size and bandwidth limit per user
  • Wake On LAN
  • Layout Designer Jump List
  • User Management – Several improvements have been made to user password management:
    • Users can change their passwords without having access to the user administration page
    • Administrators can set a regular expression to test password complexity
    • Administrators can override users passwords in a more intuitive way
  • Data Sets – DataSets are a new Xibo feature to design and display tabular data in a region on a layout. This can be useful for displaying lists such as menus and schedules.
  • Schedule Now
  • Campaigns
  • Execute Shell Commands

The list of bug fixes (108 bugs) since the last stable release is available on launchpad.

If you would like to install Xibo 1.4.0 or upgrade your existing installation, you may download it from https://launchpad.net/xibo/1.4/1.4.0.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Categories: Linux Tags: digital signage, dotnet, python, ubuntu, xibo

ConnectPort X2e SEP 2.0 Compliant Home Energy Gateway with Zigbee Connectivity

February 1st, 2012 No comments

Digi International announced the “ConnectPort X2e for Smart Energy”, a Linux-based Home Energy Gateway with Zigbee connectivity based on Freescale Home Energy Gateway Reference Platform powered by Freescale i.MX28 processor.

The “ConnectPort X2e for Smart Energy” is upgradable to comply with the new Smart Energy 2.0 Profile (SEP 2.0)  and  enables ZigBee devices on a Home Area Network (HAN) to communicate with an energy service provider.

Home Energy Gateway based on Freescale Reference Design

Digi ConnectPort X2e for Smart Energy

The new gateway is a low-cost, enhanced version (hence the “e” in X2e)  of Digi’s ZigBee Smart Energy Gateways.  The device connects ZigBee Smart Energy devices from a Home Area Network (HAN) to an energy service provider via broadband. It supports over-the-air updates of connected Smart Energy devices, making it easier for utilities and application partners to establish and maintain large Smart Energy device deployments.

The company offers two models namely:

  • ConnectPort X2e, ZigBee SE Coordinator for stand-alone Smart Energy networks that do not have smart meters.
  • ConnectPort X2e, ZigBee SE Router to connect and read the smart metering system which has been installed at the site.
ConnectPort X2e Application Example

Digi ConnectPort X2e Deployment Example

End-users can use Digi’s Smartlee application for iPhone and Android and/or utility-hosted websites to monitor and even control their electricity consumption in real-time.

The ConnectPort X2e uses the iDigi Device Cloud service to manage connectivity, configuration and software upgrades as well as application integration enabling  the Home Area Network (HAN) and Smart Energy devices, such as Programmable  Communicating Thermostat (PCT) and In-Home Display products from other manufacturers.

Here are Digi “ConnectPort X2e for Smart Energy” specifications.

  • General
    • Management – Secure enterprise management via iDigi Device Cloud
    • Protocols – UDP/TCP, DHCP
    • LEDs – Power, Network (LAN/WAN), ZigBee (HAN/PAN)
    • Security – SSL tunnels
    • ZigBee – XBee® ZB SMT transmit power 6.3 mW (+8 dBm); Receiver sensitivity (1% PER) -102 dBm
    • Ethernet – 10/100MBit – RJ-45 Port
    • Dimensions – (L x W x H) 7.62 cm x 7.62 cm x 2.54 cm
    • Weight – 70 grams
  • Development
    • ZigBee – Public Application Profile Smart Energy 1.1 (Backwards compatible to 1.0)
    • Python – Version 2.7.1
    • Memory – 64 MB Ram, 128 MB Flash
  • Power Requirements
    • Power – Input 5 VDC
    • Power Consumption – (Typical): 1.2 W, Max: 2.5 W
  • Environmental
    • Operating Temperature -  0° C to 40° CF)
    • Relative Humidity – 5% to 95% (non-condensing)
    • Ethernet Isolation – 500 VAC min per IEEE802.3/ANSI X3.263
  • Regulatory Approvals
    • Safety – EN60950
    • Emissions/Immunity – CE, FCC Part 15 (Class B), IC, ETSI

As you can see Python is used for application development on the platform. Resources for development with Python on Digi International devices are available at http://www.digi.com/technology/drop-in-networking/pdr.

The ConnectPort X2e for Smart Energy is available now for 105 USD  for both the coordinator and router version. A Wi-Fi version will be released in Q2 2012.

Further information is available on ConnectPort X2e for Smart Energy page. For technical details, you can read my previous post entitled Freescale Home Energy Gateway Reference Platform.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter