RandomSequence

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Thursday, August 15, 2013

110GB+ worth of photos/videos on a microSD memory card #2

Posted on 12:13 AM by Unknown
In my previous post, I talked about wanting to write a script to see how far I can squeeze 110GB worth of media (photos and videos).

I wrote the script the quick-and-dirty way, in PHP. When people think of PHP, they think of web pages, but PHP can equally be used for writing your everyday scripts, just like Perl or Python.

The script resizes all photos to a maximum width/height of 1024. I found this provides maximum size reduction for the photos without sacrificing the viewing quality in full photo mode on my tablet (screen resolution: 1280x800). Obviously it will affect the quality when zooming in, but I rarely do that when flipping through the photos. Since I haven't got a tablet with retina display yet, I am not sure how that will fare, but for this exercise, I am sacrificing quality for size.

For videos, I use handbrake-cli to transcode all of them to MP4 with a maximum width of 640. Again, this reduces the size drastically, improves compatibility (since all Android tablets/smartphones I have come across so far can play MP4 with no problems) and looks OK quality-wise on my tablet.

The script takes a source directory and replicates the folder structure in a target directory. It transcodes all files with certain extensions (configurable in config.php) and places them in the corresponding target subdirectories. If the file has already been transcoded, it will not be transcoded again, so it will be relatively quick to update the target directory after adding more files to the source directory.

The script took 1.5 days to transcode my 110GB collection (bear in mind this is a older, slower AMD Turion II laptop). The result was only 29GB and fits easily into a 32GB microSD card.

I popped the microSD card into my tablet and viewed the files using QuickPic. The result was awesome.Check it out in the video below:



Note that this video was produced with the microSD card inserted into an al-cheapo single-core tablet bought for the kids during a sale. I was pleasantly surprised by how quick and smooth it was. Needless to say, on my own 10" quad-core tablet, the result was even better.

QuickPic is a better app than Gallery for this purpose because:

1. It allows you to set "Include Folders" to include only the media files from the microSD card

2. It lets you set the 'Explorer View" to browse through the folders/subfolders in a hierarchical manner.

3. It has "Stack", "Grid" and "List" views for different visual summaries of the folder content.

4. It is quick and has tons of other options.

The result of the transcoding operation exceeded all my expectations. I have a snapshot of 110GB worth of media on a tiny memory card, ready to be popped into any tablet or PC to view. At only 29GB, there's lots of room for growth, especially on a 64GB microSD card (which no doubt all tablets will support in the future, even cheapo ones).

If you think you might find this useful, you can download the script below. It includes the PHP and Handbrake-CLI binaries so it should be ready to run under Windows. It shouldn't be too difficult to adapt the script to work under other platforms as well.

After download, unzip into another directory and edit config.php. You only need to change $srcdir and $tgtdir. Then bring up a command prompt and run transcode.


Once you verify that everything works correctly, you may want to schedule it to run periodically via the Task Scheduler.

Download: Batch Media Transcoder V1.0 (ZIP 25.2MB)

Download: Batch Media Transcoder V1.0 (7-ZIP 17.1MB)
Read More
Posted in transcode | No comments

110GB+ worth of photos/videos on a microSD memory card #1

Posted on 12:12 AM by Unknown
We have a family NAS where we keep all kinds of stuff. Well, actually it's an old laptop that functions as a server, with 3 x 3TB external USB HDDs attached. I run all the standard mirroring and backup on the laptop, and one of the HDD is shared over the network for everyone to dump their stuff into.

Like most family these days, we take photos and videos on a number of different devices. The smart phones, digital camera, DSLR etc. Even the kids have their own cheap digital compacts. And the devices have evolved over the years. The photos have mostly stayed JPEG, with the resolution increasing steadily. The videos, however, are a different story. Starting from the V8 (which we converted to XVID AVIs) to a Sony (which produced MPEG-1 files) to a Casio (which gave us H264/MOV files) to the current-gen Sony (MTS format), there's an incredible number of video formats we have to deal with. On top of that, we do scans of old photos and slides, the kids' artwork etc. These are all dumped into the family NAS.

To avoid being locked into a particular platform, we resisted moving to any software that relies on an underlying database for organizing the photos. Instead we created folders (2010, 2011, 2012 etc) and subfolders (eg. 20100825 Adam's Birthday Party) within the underlying filesystem to organize the photos. With the subfolders, the photos and videos are renamed to "YYYYMMDD-hhmmss" format. jhead is a great help batch-renaming of photos. For video files, the strategy varies. And not all filles can be renamed this way (eg. the scanned photos). Though crude, this has mostly worked. It is also quite flexible when it comes to backup and batch processing.

For viewing the photos, we use XnView.


IrfanView works as well, but it requires more tinkering to get it working with the different video file formats that we have. XnView works pretty much out of the box with the video files.


These two apps have a number of advantages going for them:

1. They are both freeware with lots of plugin support.

2. They work at the filesystem level, and we can easily expand/collapse the folders/subfolders to view our media archive. Some apps require you to import the media that you want to view.

3. They display both photos and videos, both at the thumbnail and individual media level. Most media viewing apps support only photos.

4. They are portable, meaning they can be easily copied/moved from machine to machine without re-installation and executed with their settings intact.

The downside is that both apps are not particularly sexy, but they do get the work done quickly and effectively.

One problem I face is that the photo/video archive on the NAS is standing at 110GB and growing steadily. I want to be able to view this archive on my Android tablet, which is a very natural medium for perusing all the photos and videos that we have accumulated. But fitting 110GB of files into the tablet is next to impossible currently (the largest microSD card is 64GB), and even if I could, the tablet won't be able to deal with all the video formats in the archive (the 1080p MTS files are particularly problematic).

So I decided to write a script to transcode all the files in the archive to a smaller size to see how much I can squeeze it down without ruining the viewing experience on the tablet. This will be the topic of my next post.


Read More
Posted in transcode | No comments

Saturday, August 3, 2013

Coding the Liturgical Calendar

Posted on 1:14 PM by Unknown
For a long time, I've wanted to integrate the Roman Breviary into a couple of projects (nothing public) but have never been able to find a suitable calendar, breviary or psalter implementation.  So I wrote one in python.  It requires the `dateutil` package, but other than that its standard python.  My principle use of this is going to be to create a JSON interface to get the current office, season, feast-day and reading from the 1962 Liturgical calendar.  I am working on a "modern" liturgical calendar, its just not my priority right now. 
Read More
Posted in coding, geekery, software | No comments

Wednesday, July 31, 2013

Fast Diet - Hunger Pangs

Posted on 3:41 PM by Unknown
When I am doing the Fast Diet, I frequently experience long periods of calm after a brief period of hunger pangs. It is as if the body has gone into hibernation, and I am left well alone to carry on with my daily routine. This is most apparent the morning after the diet day, when I could usually skip breakfast and have a late lunch.

I am reminded of what my diving instructor told me during training many years ago, that feelings of suffocation after a brief period under water is not due to lack of oxygen, but due to the buildup of carbon dioxide in the blood stream. This means you are not going to die (yet), and with knowledge you should  try to suppress the panic, remain calm and find a way out of the current situation to surface.

Hunger is mostly the same thing. It makes us uncomfortable and compels us to eat to rid ourselves of the discomfort. Worse, we have come to associate a lot of other feelings (both positive and negative) with eating. So we eat to make ourselves feel better, not necessarily when we are hungry. And this slowly builds up over the years in the world we live in today, where food is available in abundence 24x7.

I think occasional calories restriction (which is essentially what the Fast Diet is about) serves to remind ourselves that it is OK to feel hungry, that you don't have to eat at the first sign of hunger. It also serves to calibrate the "gauges" in our bodies and I think that's where the health benefits are derived.
Read More
Posted in fastdiet | No comments

Sunday, July 28, 2013

Looking for the perfect car MP3 player/FM transmitter

Posted on 4:46 PM by Unknown
I have bought quite a number of car MP3 player/FM transmitters from DealExtreme and other similar websites.


A car MP3 player/FM transmitter is a device that takes a SDHC memory card or a USB memory stick and plugs into the car cigarette lighter socket. It plays the MP3 files stored on the memory card/stick and transmits that as FM signal to be picked up and played by the car stereo.

It is a nifty and convenient device because not all car stereo can play MP3 files, or be able to accept a memory card or stick. Also such a device is very portable. You can simply plug it into any vehicle eg. a company car and it will play all your favorite music.

Other alternatives exist eg. bluetooth, but they are simply not as straightforward and universal as this solution. After all, you'd be hard-pressed to find a car without a cigarette lighter plug.

The perfect car MP3 player/FM transmitter should have the following characteristics/features:

  1. Emits strong FM signal
  2. Remembers last FM frequency used
  3. Remembers last MP3 file played
  4. Remembers position of last MP3 file played
  5. Supports Unicode font on LCD display
  6. Body of memory card should not stick out when plugged in
1 and 3 are pretty much essential for the device to be useful. Unfortunately I have had to throw at least .a few devices away right upon arrival because they were lacking one or both of these features.

2 and 4 are good-to-have features (some may even consider them essential). 2 can be overcome by setting the car stereo to the default frequency, but sometimes you need to change the default frequency on the device because of interference, and having to do that during every cold start gets old after a while.

4 should be quite easy to do (just a little extra memory to store the last play position), but surprisingly I have not seen any device that has this feature! Either there is some unknown technical barrier to implementing this feature, or Chinese manufacturers are .too stingy to spend a few more cents to do so.

5 is a nice-to-have, since none of my Mandarin songs have their ID3 displayed correctly. On the other hand, this is understandable because it will probably add a lot to the production cost to embed a Unicode font into such a tiny device.

6 is simply a design issue. Half of the devices have it right, others have the memory card sticking out so badly I wonder what the designers were thinking.

I have yet to find my perfect car MP3 player/FM transmitter. I have bought at least a dozen such devices now, and none of them have all of 1,2,3 implemented, not to mention the others. The local Chinese OEM devices sold in Oz stores are not .much better.

Anyway, if you know of the perfect car MP3 player/FM transmitter, please leave me a comment. I am willing to pay a premium for such a device, but I am tired of buying one device after another and being disappointed over and over again...


Read More
Posted in hardware | No comments

Wednesday, July 24, 2013

Children - The ultimate test in anger management

Posted on 5:26 PM by Unknown
Having just spent two full holiday weeks with my kids, it occurred to me this morning that raising young children is the ultimate test in anger management.

You know the lines. Address the situation, not the other person. Bring change to yourself first, not to the other person. Easy on paper, very difficult in practice.

With adults, it is often easy to blame it on the other person. After all, he/she is a full-grown adult, why can't he/she be more mature, rational, have a good grounding in the facts etc.?

With children, you can't pin the blame on them anymore! They are what they are at this age. You can't expect them to be mature or rational! But we still lose our cool, and that's a perfect reflection of our own emotional management skills.

Therein lies the ultimate test in anger management. We have to change ourselves to address the situation, and that ain't always easy,  because being human means we resist change with all the might we could muster.

Failure to manage our anger eventually leads to child abuse. The male gender is more frequently associated with such behaviour, but it seems the female gender is sometimes not spare such emotional rampage too.

Our children grow up with us, but we grow up with our children too. Good luck to all the parents traveling on this amazing journey together!
Read More
Posted in life and the universe | No comments

Saturday, July 20, 2013

Fast Diet - Incredible Body Hack

Posted on 1:38 AM by Unknown
In terms of body hacks, the Fast Diet probably ranks all the way at the top for me.

I first read about it in the papers and found the technique rather intriguing. Could something that simple actually work? Besides the book, it didn't really have anything fancy to sell. No secret formula, patent-pending ingredient, celebrity endorsement etc.

A few weeks later, at a whim, I started to try the diet on myself. At this point, I have not read the book yet. I just started restricting my diet two days a week to 600 calories. And I wasn't too particular with counting the calories either. I simply looked it up on the smartphone and kept a rough count through the day. Sometimes I prepared the food specifically for myself. Other times, I simply ate a smaller portion of whatever the wife had cooked. One or twice, I actually broke fast midday as unexpected commitments cropped up.

I also wasn't particularly keeping a keen eye on my weight during this time. Ironically, I didn't really think the diet would work. It just seems too free-and-easy. Not enough suffering! Then about 8 weeks later, I weighed myself in the bathroom and found that I had lost 6kg. To say I was surprised was an understatement! I started weighing myself more regularly from then on, now out of curiosity then anything. I found myself steadily losing weight at a rate of about 0.5kg per week. Another 8 weeks on, I have lost another 3kg or so. I haven't seen this weight for a long long time, not since my university days!

And I was still eating all my usual junk on the off days: cakes, chips, chocolate, fries, fizzy drinks. Nothing "health conscious" has crept into my mindset so far that I was deliberately avoiding them. I was just eating normally as before.

I did pick up the book to see if I coud learn anything new, but I didn't. I am quite familiar with scientific studies of how severe calorie restriction can prolong life, but most of us can't live that way. Even ADF (Alternate Day Fasting) seems too harsh to me. I think the breakthrough for the book is to introduce the idea that even a moderate amount of fasting will do us plenty of good. Other than that, I am not sure one has to read the book in order to get started on the diet. I don't even find the recipes in the book particularly useful. As I mentioned, I did quite alright with eating whatever my wife cooks, but in smaller quantities.

The book did mention that once you reach the desired weight, you can go into "maintenance mode" and reduce the fasting to once a week. For me, I plan to carry on fasting twice a week just to see how far this diet can hack my body weight. I am pretty sure my weight will stabilize at a certain point and will not reduce indefinitely! I will blog about my progress in times to come.
Read More
Posted in fastdiet | No comments
Older Posts Home
Subscribe to: Comments (Atom)

Popular Posts

  • 110GB+ worth of photos/videos on a microSD memory card #2
    In my previous post, I talked about wanting to write a script to see how far I can squeeze 110GB worth of media (photos and videos). I wrote...
  • Ubuntu: WebDAV + DAVfs2 + FUSE == Thunar Goodness
    One of the corner-stones of any *nix utility is that it should do a simple job and do it well. Every piece of software that I can think of ...
  • Adding "Stereo Mixer" to Windows 7 with Conexant sound card
    This procedure worked for my laptop (Thinkpad E530) with a Conexant 20671 sound card, but I suspect it will work for other sound cards in th...
  • Thinkpad Edge E530 won't wake up from sleep
    I recently purchased a Thinkpad Edge E530 laptop from Lenovo. I think it is great value. I ordered it with the default 2GB RAM and bumped it...
  • Youth Chess
    Calling all chess geeks in the Sioux Falls area.  Here's the deal: I have, for the past several years, had siouxfallschess.org registere...
  • Booting to DOS from a USB memory stick
    Now that the floppy disk is ancient history and optical media is not far away, it seems we still have to boot to DOS from time-to-time to pe...
  • Taste of New York
    Today, a couple co-workers and I went to Taste of New York (TNY) for lunch. Its a new pizza joint in down-town Sioux Falls. Ordinarily, su...
  • odf-converter-integrator - OpenOffice.org Ninja
    odf-converter-integrator - OpenOffice.org Ninja In grand fashion, MS Office 2007 uses completely different file formats from those of previo...
  • Sexify Your Linux Desktop
    I have been playing with beautifying my Linux desktop, and I think I've made pretty good progress, in large part thanks to three little ...
  • Jamming Flagpoles
    Today I read a report about Iran's alleged "flagpole jamming network".  Reading all of this, it became plainly obvious that, ...

Categories

  • a2dp
  • administrata
  • android
  • antivirus
  • avi
  • bluetooth
  • chrome
  • coding
  • culture
  • dos
  • eee
  • faith
  • family
  • fastdiet
  • firefox
  • gadgets
  • geeekry
  • geekery
  • hardware
  • homeschooling
  • howto
  • java
  • laptop
  • life and the universe
  • linguistics
  • link2sd
  • linux
  • migration
  • mp4
  • pdf
  • politics
  • printer
  • roomba
  • security
  • soapbox
  • software
  • transcode
  • travel
  • ubuntu
  • video
  • virtualization
  • webapps
  • windows

Blog Archive

  • ▼  2013 (11)
    • ▼  August (3)
      • 110GB+ worth of photos/videos on a microSD memory ...
      • 110GB+ worth of photos/videos on a microSD memory ...
      • Coding the Liturgical Calendar
    • ►  July (6)
    • ►  June (2)
  • ►  2012 (25)
    • ►  December (2)
    • ►  November (4)
    • ►  October (4)
    • ►  September (1)
    • ►  June (11)
    • ►  May (3)
  • ►  2011 (11)
    • ►  December (1)
    • ►  September (2)
    • ►  August (1)
    • ►  July (3)
    • ►  April (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (1)
  • ►  2010 (10)
    • ►  December (2)
    • ►  October (1)
    • ►  September (1)
    • ►  August (2)
    • ►  July (1)
    • ►  May (1)
    • ►  March (1)
    • ►  February (1)
  • ►  2009 (29)
    • ►  December (2)
    • ►  November (2)
    • ►  September (1)
    • ►  August (3)
    • ►  July (2)
    • ►  June (5)
    • ►  May (2)
    • ►  April (2)
    • ►  March (6)
    • ►  February (3)
    • ►  January (1)
  • ►  2008 (57)
    • ►  November (2)
    • ►  October (4)
    • ►  September (1)
    • ►  July (8)
    • ►  June (3)
    • ►  May (8)
    • ►  April (12)
    • ►  March (6)
    • ►  February (8)
    • ►  January (5)
Powered by Blogger.

About Me

Unknown
View my complete profile