Thursday, October 18, 2012

Samsung Galaxy Player 4.2 review

I wanted to dump my iPod Touch for a very long time. My main use for this player was reading books and listening to the NPR podcasts. I hate iTunes with passion and wanted to rid myself of Apple and iTunes.

I went ahead and bought Galaxy 4.2  after some research. After using it for about 2 weeks all I can say that it is infinitely better than the iPod at least from my point of view. It is better in all of the tasks for which I used my iPod.
The FBreader (ebook reader) is much better than Megareader I used on iPod. There is just no comparing the two. The screen of the Galaxy is larger, and has better viewing angles. The battery life is comparable and it probably can go for a week or so on one charge if reading for about an hour a day. Over all very good experience.
The music player is just as good the the Galaxy and the sound quality is better to my ears. There is also FM radio which works very well.
Included applications are very good and you can just use the device out of the box without any installing many additional applications. The simple task manager is included together with a few very popular games and synchronization apps. Also included chat, IM and navigation software. I have not even tried all of the apps that came with this device.
Galaxy handles various video formats but I only tried Divx and mp4 files so far. It also can decode high resolution videos which my iPod could not. It saves some transcoding time.
The device comes with the wall charger and uses micro-usb connector for charging and my cellphone charger does work. This saves me the trouble of having an extra charger when traveling.
I purchased a TPU case from eBay and a screen protector from Amazon and would highly recommend for anyone to do the same. The player body is plastic and would probably suffer if dropped on a hard surface. I would prefer a softer silicon case as I had for my iPod but unfortunately the selection of cases for this player is very limited. The screen protector is OK but somehow not as good as the one I had on iPod. It was a wet install and it came out a bit wrinkly at the end but this is in no way Galaxy's fault. So far the only issue I found with this device is that the third party accessories are not as numerous as for iPod.
The battery in this device is user replaceable so there is no frustration of replacing the battery like with iPod, also storage is expandable via MicroSD card. If you are watching movies or using a lot of large games this would definitely help. So far I have not tried this feature since I am mostly reading books on the Galaxy.
Some online reviews complained about device performance. I compared it to the Galaxy Nexus phone and there is a slight difference but it is not large. I have not noticed any problems or slowdowns. The user interface is smooth and applications start fast. The video and audio playback is perfect. The browser is very usable, just as good as on the Nexus and way better than on the iPhone 4S. It is just more usable because of the larger screen. Because of the slower single core CPU battery life is better on the Player than on the Galaxy Nexus phone. I am definitely willing to compromise performance for better battery life but other people may have a different opinion.
If you want to replace your iPod and like me do not want to get an Android phone that you have to charge every day, the Galaxy Player is an excellent device. I only had to install 2 applications to make it completely perfect for me - GrooVe IP and FBreader.

MPEG-4 (Xvid or Divx) on Roku

In my earlier post I wrote that Roku can decode MPEG-4 encoded files. This is only partially correct. The Roku can decode some of the MPEG-4 encoded files just fine but some other files produce heavy stuttering during panning scenes. The reason is unknown to me as of yet.
The problem files should be transcoded in to h264 using ffmpeg or Handbrake. Using ffmpeg and veryfast or ultrafast preset video can be transcoded very quickly at about 10x of real time playback rate on the Phenom x4 9750.
Most of the MPEG-4 encoded files however can be decoded on Roku without any problems as long as you convert them in to the mp4 container and re-encode the audio. The file size will be smaller when it is transcoded  to the h264 but if you want to save time and for "watch once" content the MPEG-4 option is good.

Thursday, October 11, 2012

Roku BIF files

Your Roku supports pretty cool way to do trick modes - the bif files. I think this is Roku specific mode because I have not seen anyone else doing this. The bif file is essentially archive of the frames in jpeg format with an index at the beginning of the archive. Each frame is taken periodically, every 10 or so seconds. Roku SDK contains a biftool utility for Linux and Windows and also a document describing internal format of the bif file. This document is very basic but it gives an initial understanding. I think a Python script would be more useful and more portable since it would run on any system and would provide the source code to fix any bugs.
To create bif file you need to extract frames from your video and save them in to jpeg files. Each file is named as a number starting from zero, i.e. 00000000.jpg, 00000001.jpg, etc. The number in the name signifies the position in the index of the bif file. The position is multiplied by the interval that you provide when generating the frames and when creating the bif file. For example if your interval is 10 seconds and your file name is 00000023.jpg the frame would be located at 230 seconds in to the video. When you navigate in your video, Roku would show frames from the bif file corresponding to current position in the video. The effect is pretty neat but it has problems. The first problem is that it is hard to achieve a good precision in this manner. The generated frames do not correspond to the key frames and when you start your video it is usually a few seconds off the displayed frame, I would say within 10 seconds. The second problem is that the process to generate bif file takes time and I am not sure if it is worth the effort.

The process

The process itself is pretty simple but may involve getting Roku SDK. You  would need to register with Roku and download Roku SDK that contains biftool.exe utility. There is also bif file generation tools that sold online but I have not tried them. You would also need to download ffmpeg but most of people who stream to Roku from PC would already have ffmpeg.
There is also a Python tool that generates bif file. Search for makebif.py and you will find this tool. It works just as well as the tool from Roku but you loose some control if you do not know how to program Python.
The first step is to generate frames from the video file over the regular intervals. Lets assume 10 second interval for this example but you can adjust your interval to what you feel is appropriate. Create a directory to contain you images and run the following command:
ffmpeg.exe -i video.mp4 -f image2 -r 1/10 -s 240x180 directory/%08d.jpg
I encountered a problem with the later version of ffmpeg - the first few images are generated at a very short interval. This causes all remaining images to be off by a few seconds. To remedy this problem first few images should be removed and the rest should be renamed accordingly. Shell script would do the job.
Next step is to run the biftool.exe to generate the bif file:
biftool.exe -t 10000 directory 
The -t parameter indicates interval between images in milliseconds. There are other parameters that can be passed to the biftool but they do not seem to work. This will create a file named direcotry.bif which is the resulting bif file. You need to rename this file in to a video.bif to match the name of your mp4 file. Now load up your video in MyMedia player or your other favorite player and enjoy. During the fast forward operation the images would be displayed instead of a simple progress bar.

The conclusion

I am not sure if the process is worth the effort if you want to watch a video just one time. It may be worth the effort for your kids videos or something that you want to keep and will watch over and over again. I also think that the biftool from the Roku SDK is pretty poor and the python version is much better, especially if you can modify it. The python version can be made to automatically delete first few images and can be fixed if any problems are found. At the end the process and the result was fun to try. If you are in to organizing your video collection this maybe something that would be useful to you.