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.

Thursday, September 27, 2012

Encoding content for Roku 2 and MyMeida

There are many sources on the Internet that explain how to encode content for Roku 2. Unfortunately most of the sources are obsolete and use outdated versions of tools. I will try to share my experiences in this post.

The simplest way to encode content for Roku is to use Handbrake. The current version 0.9.8 includes Normal preset which works well with Roku. The High preset also works but sometimes produces out of sync video and audio. It also takes significantly longer time to encode with the High preset. Selecting MP4 container and leaving all other options in their default state works well and gives reasonably fast encode with good quality video. Please note that Normal preset does not support multichannel audio by default.
Encoding with ffmpeg is a little bit more involved but gives a great deal of control over encoding time as well as encoding quality. This is example command line that works with ffmpeg version 20120924-git-bbe9fe4:
ffmpeg.exe -i "video.avi" -acodec libvo_aacenc -ab 128k -ac 2 -vcodec libx264 -preset veryfast -profile main -crf 18 -threads 0  -y "video.mp4"
This will produce video compatible with Roku but the bit rate would be on the higher side. To decrease bit rate different preset can be used. Following presets are available - ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo. Start with medium (default) and go faster until the balance between encoding speed and bit rate is satisfactory. You can also use high profile but it will slowdown your encoding. When using high profile specify -level 4 option because Roku does not support anything above level 4:
ffmpeg.exe -i "video.avi" -acodec libvo_aacenc -ab 128k -ac 2 -vcodec libx264 -preset veryfast -profile high -level 4 -crf 18 -threads 0  -y "video.mp4"
Faster presets generate larger files and slower presets generate smaller files. Try it out to see which one works well with your computer and gives you smallest file in an acceptable time. The veryslow and placebo presets together with high profile do not work with Roku and cause macroblocks and frozen picture during decode

To my surprise Roku can also decode MPEG-4 Part 2 (Xvid). Any avi file that is encoded with this codec can be quickly converted in to MP4 file without re-encoding the video. Audio most likely has to be re-encoded but this takes much less time than video encoding. Roku only supports AAC audio and Xvid files usually contains MP3 or AC3 audio. To convert compatible Xvid file use this command:
ffmpeg.exe -i "video.avi" -acodec libvo_aacenc -ab 128k -ac 2 -vcodec copy -threads 0 -t 120 -y "video.mp4"
To test if your file would work without completely converting it use -t 120 command line switch. This would convert first 120 seconds of video and allow you to test it out with your Roku. Remove this switch from command line after you satisfied that the resulting video works. Xvid was and still is a very popular codec and people accumulated a lot of content encoded with this codec. DivX codec should also be compliant with MPEG-4 Part 2 but I have not tried converting this type of files as I have none.

I found that Roku MKV support is very poor when streaming over the network. The device often crashes when starting video playback or trying to seek within the content. When played from the USB stick there are no such problems. To avoid any issues it is best to convert mkv files in to mp4 which can be done without re-encoding video and audio in most cases. You need to make sure that your mkv file contains h264 video and AAC audio. You can do this by using ffprobe which is a part of ffmpeg package. You can convert container with ffmpeg or mp4box tool. Following command line works with ffmpeg:
ffmpeg.exe -i "video.mkv" -codec copy "video.mp4"

Stay tuned for more Roku information.

Sunday, September 23, 2012

Handbrake Lipsync and Roku

I occasionally have lipsync problems with Roku when encoding videos with Hanbrake. Handbrake does not appear to give you any control over audio or video delay. In theory, if the source is correctly synchronized the output should be synchronized as well. In practice that works only with VLC but not with Roku.
I found that the profile selection affects lipsync the most. I am not sure why that is, but Roku handles high profile poorly as far as audio synchronization goes. I performed several tests and all of them came out with the same result - audio is ahead by about 1 second. VLC plays these videos correctly but in Windows Media Player lipsync is off the same way as Roku. This can serve as a test - if WMP plays video correctly, Roku will too.
What is interesting that the "Preview" does not show any issues in WMP or VLC, therefore checking just preview alone would not help. You would need to encode about 10 minutes of video to judge correctly.
If you are encoding lower quality file, it does not make sense to encode in high profile as the source is already low quality. If you want to preserve quality as much as you can, adjust "Quality" slider in the "Video" tab to 18-19. You will get a bit better quality at the expense of the file size.
At this moment my recommendation would be to stick with "Normal" preset when encoding for Roku, especially for lower quality content.

Saturday, September 22, 2012

WDTV Live has many problems

Today I sent WDTV Live device back to the store. It was an easy decision and I understand why it was returned the first time around. Below is incomplete list of problems that were encountered during the week WDTV was in my possession.

The avi files do not play well over DLNA or Samba share. To be honest, some files do play but most  stutter. The high bitrate mp4 files do not play well at all. Roku plays these same files without any hitch. The wmv files also hit and miss. Some do play really well, some do not play at all.

User interface is very clunky and slow. If the DLNA server crashes, the box completely freezes or becomes so unresponsive that it is useless. At this time the box must be rebooted to bring it back in to the working state.

Different video controls are available depending on the type of the video file which makes the UI inconsistent. The mp4 files and the mkv files can be positioned to a time point, the wmv and the avi files cannot. Files or all types can be fast forwarded but the max speed is only 16x and it seems much slower than that in practice.

Hulu application is much worse than the one on Roku. This is one of the most used services in our household because we do not have cable so it is important that Hulu app works. With WDTV  only few shows can be played and then application needs to be restarted in order for it to work. The ad insertion on Roku is almost like in broadcast tv. On WDTV the ads buffer separately and there is a significant pause before and after the ad. It makes duration of the show to be almost as long as over the cable. The only useful feature of WDTV Hulu app is that one can force maximum bitrate . The app on Roku is much newer version than the WDTV and that may explain the difference.

The "channel" selection on WDTV is  much smaller than on Roku and the box looses big in this respect. The server software for Roku is very simple, MyMedia being an excellent server. The server software I used for WDTV was the PS3 Media Server. This server is very reasonable but it gets huge after running for a while and has to be restarted. It also takes a bit of knowledge to configure this software correctly. Live transcoding mode supported by this server does not work well on my quad core Phenom so I have to transcode offline which negates some of the convenience.
At the end I could not figure out a format that would be well supported by both Roku and WDTV and as a result each file should be encoded in two formats. If you would like to watch content on both devices the size of your library would double.

Given all of the above my derision was to standardize on Roku boxes to minimize size of the library and improve over all experience. Too bad no company can figure out how to do networked media player correctly.

Tuesday, September 18, 2012

Update on WDTV subtitles and more

I have been trying to get WDTV subtitles working with mp4 format so I don't have to keep separate format for Roku. So far I learned a few things. First is that WDTV does not appear to understand internal subtitles inside mp4 container. I was able to multiplex subtitles using ffmpeg as well as mp4box. In both cases VLC was able to play subtitles but WDTV was not. The second thing I learned is that Roku does not appear to understand multiplexed subtitles ether. This fact is apparently documented on Roku forums and elsewhere online. The third thing I learned is that WDTV is pretty bad at playing mp4 files. Somehow the playback is very choppy and the video freezes a lot. Monitoring consumed bandwidth I found that it is very low and is not enough to play the content smoothly. Converting the file in to mkv container without transcoding, fixed all playback problems. The bandwidth consumption became much more even and video played without any issues. This was a bit surprising as Roku played the same mp4 file rather well.

Monday, September 17, 2012

WDTV subtitles from DLNA server

So far I could not figure out how to stream external subtitles from DLNA server. However WDTV supports MKV container and subtitles can be embedded in to the video file. To do this use mkvmerge tool from the mkvtoolnix set. Obtain the srt subtiles for the content you want to watch and then run following command to merge the subtitles and the video in to one mkv file:

mkvmerge.exe -o output.mkv input.mp4 input.srt

This will produce the mkv file that can be streamed over DLNA and your WDTV will be able to display the subtitles. Roku on the other hand can not display subtitles from the MKV container and needs an external file. Given that Roku often crashes when playing or navigating in the MKV file, you would need to keep a separate mp4 file and a srt file for the playback on Roku.

WDTV Live again

I took my replacement Roku back to Costco and decided to give WDTV Live a second try. The box arrived from Amazon and I was excited to to open it and start comparing it to Roku (again).


The WDTV box is obviously larger than Roku but that does not bother me. Ether box is small enough to be placed somewhere near your TV.  The WDTV is also more power hungry than Roku, it has a larger power supply and runs much warmer. The WDTV is noticeably warm on touch even when in the off state. The box is running Linux and clearly does not power off, other than turning off the video output and the led. Nether does Roku but the chip it uses is less power hungry.

After spending 2 days with the WDTV, I am back to thinking that Roku has more polished product, despite all of the shortcomings. But let me describe things in order.
Configuring WDTV box takes about the same time as Roku - you need to configure network and your TV output format. The WDTV has few more customizable options that allow you to set various things but over all experience is close. The WDTV does not have any downloadable apps so the configuration ends here.
We only have Hulu Plus so I registered box with the Hulu site and tried watching some content. The Hulu app on WDTV is somewhat different from the Roku version. Queue display is different and also the WDTV app allows you to set the bitrate, which is a great feature! Roku app often stutters because the bitrate of the content is too high and there is no way to get it down. When I run in to this problem I will try to compare the two boxes and post my observations.
The local content playback is the area where WDTV suppose to shine. It does play any format that I have tried. It played all the MKV files, that caused Roku to reboot, without any problems. There were however few issues.
First problem was to get Windows7 to share the files. This task should become simpler to accomplish with Windows7, in reality it was more complicated than XP. For some reasons after enabling Home Group sharing the WDTV still did not see the the directories. Eventually after some fiddling with the settings, the box could see the shares and play the videos. It worked OK for the lower bitrate videos but somehow higher bitrate made it stutter. I assume the problem is with Windows networking being too chatty. Same videos over DLNA worked just fine.
The second problem is finding a good DLNA server. I have tried every free DLNA server running on Windows that is listed on Wikipedia. I wanted a small footprint DLNA server since at the base of DLNA is just a simple web server. Most of the servers are large and some of them are unstable. When the DLNA server crashes the WDTV box gets very unhappy! The menu is completely unresponsive and the only reasonable solution is to pull the power plug.
At the end I settled on two candidates - PS3 Media Server and Serviio. Both seem to behave more or less OK although both use copious amounts of memory, with Serviio being a little smaller.
One thing I wanted to mention in conclusion - I could not get external subtitles to work with the DLNA server. If subtitles are important to you Roku seems to be easier to get working with the external subtitles.
I will keep this blog updated on my experience with WDTV over the next few weeks.

Saturday, September 8, 2012

Roku: review after few months of use

We have used our Roku XS devices for a few months and there are few things I wanted to say.

The honeymoon is over

 I liked this device initially but as I used it more and more my opinion about it plummeted. Now the initial good impression is completely displaced by its problems and quirks. For starters there are a lot of problems with the hardware and the software. My first Roku XS remote is died within a week and I took the device back to Costco for a replacement. My second Roku XS was rebooting randomly when in the sleep mode and not booting back after that without power cycle. I took that one back to Costco too. I did not even unpack the replacement Roku and will take it back this weekend after more frustrations with the current unit.

Roku problems

Where do I begin? 
Automatic updates to the software - this has to go. Roku updates itself to the new version of the software without any way to revert back. The new software at times is worse than the previous but there is no way to stop the update. If you find a good version of the software you can't keep it on your device. The bottom line is that this feature will bite Roku (the company) in the rear one day.

HuluPlus - we have been using this service to watch TV after dropping the satellite. The app is bad from usability standpoint and also the service is slow. I have no problems with their content, if one does not like the content, one does not have to subscribe. I do have a lot of problem with their inability to deliver it. Half of the movies that I tried from Criterion collection fail to play smoothly. Hulu states that I need 3Mb/s service for HD quality. Well, I have 19Mb/s at all times and I want to watch SD. There is no way to select SD on Roku and videos do not play well. The transition between commercials and content often result in macroblocking for a few seconds. Browsing content is also terrible as it is very slow on the Roku app. The app itself is huge memory hog and does not stop running when you exit from it. Because of this all other apps suffer when Hulu is started.

Codec and container support on Roku is terrible. They should fire the QA department and get a new one. The only codecs they claim to support is the h264 and the WMV. That is a blatant lie. WMV is not well supported and a lot of videos do not play and worse cause Roku to lockup and reboot after watchdog is expired. Same with the container support. The mp4 container is OK. Files are recognized and played correctly most of the time, except some files produce lipsync problems which can not be fixed by transcoding. PC plays these files just fine but not Roku. The mkv container is also on the list of supported containers but this is a blatant lie as well. The files in the mkv container often cause Roku to lockup and reboot and even if the file can be played, seeking in the file causes reboots. This is my biggest problem with Roku.

Roku also claims that device supports subtitles. Technically it is true but the support is very finicky as the file must be formatted just right. VLC has no problems with the file but Roku will not play it if it is encoded in Unix format or has no empty line at the end or numbers do not start with 1 or many other reasons.

Another bad miss is absence of the parental control, as well as the inability to select applications that are loaded on the specific device under the same account. If application was removed from one device it will be removed from another linked to the same account.

Now to the general content selection. It is true that Roku has many more channels than say WDTV or a networked DVD player but most of the channels are junk, just like your cable or satellite. Hulu, Netflix, Amazon are available on most of the other devices so Roku does not get any credit here. On other devices the quality of streaming is better however. The other channels like HBOGO require subscription to the HBO on cable?! If I have a subscription to cable why would I need Roku to watch it? Private channels do add to the selection but they come and go - stop working for no reason and then start working again. Of course most of them are not getting paid but then why bother?

The user interface on the device is too simplistic and often fails to respond to the remote. I am not sure if this is app problem or in general Roku problem but with closed source system we will never know.

At the end the only app I really like is MyMedia which allows you to stream content from your PC. That app works OK and you can stream your pictures movies and music collection to the TV. It is also open source so you can modify the app or the server and add the features that you want.

Conclusion

Would I recommend Roku after a few months? Maybe, most likely not. If you want to play movies that you took with your camera or ripped from DVDs, the answer is HELL NO. If you want to watch Netflix or Hulu, the answer is maybe. I would get a networked blue-ray for that. For the same $100 you will get more functionality.
Roku is clearly used the wrong chip for their product! They should have used a chip that is capable of playing many more formats. Even the same Broadcom can supply a number of chips that are much more capable. In any event they should test the software better to make sure simply playing a file to the device would not cause a reboot!