Showing posts with label Google Nexus 7. Show all posts
Showing posts with label Google Nexus 7. Show all posts

Sunday, February 10, 2013

Frame Sizes, Bit Rates and Comparative File Sizes of HD Broadcast TV Transcoded to MPEG-4 with WinFF Presets

I’ve been testing combinations of ATSC and cable TV tuner sticks and related software for time-shifting broadcast TV and transcoding it to MPEG4 and MP4/H.264 files for playback on Microsoft Surface RT and Google Nexus 7 tablets, as well as MiniPC sticks with HDMI outputs, such as the CozySwan UG007.

imageMost ATSC TV tuner sticks, such as the Pinnacle/Hauppauge PCTV series, and their included personal video recorder (PVR) software, save broadcast TV programs in MPEG-2 transport stream *.ts files.

The full transcoding process involves these steps:

  1. Record ATSC/cable content to MPEG transport stream files.
  2. Transcode transport stream to MPEG-2 *.mpg files of common format profiles and frame sizes with source bit rates using Pinnacle TVCenter software or an equivalent utility.
  3. Edit programs to be archived with free trimming software, such as Mpg2cut2 to remove spurious leading and trailing footage.
  4. Transcode MPEG-2 to MPEG-4 or MPG4/.H264 *.mp4 files with the ffMPEG command-line tool or a GUI ffMPEG wrapper, such as WinFF.

For more information about ATSC TV tuner sticks, see the Using Pinnacle/Hauppauge Video Tuner/Decoders section of my First Look at the CozySwan UG007 Android 4.1 MiniPC Device post (updated 2/8/2013.)

ffMPEG offers almost infinite permutations and combinations of transcoding options. WinFF v1.4.2 and later provides the five built-in MPEG-4 presets with command-line parameters shown in the table below:

Preset Label/Name ffMPEG Command-Line Parameters
MP4 Fullscreen /
x264HQFS
-f mp4 -r 29.97 -vcodec libx264 -vf scale=640:480 -aspect 4:3 -flags +loop -cmp +chroma -deblock 0:0 -b:v 1250k -maxrate 1500k -bufsize 4M -bt 256k -refs 1 -bf 3 -coder 1 -me_method umh -me_range 16 -subq 7 -partitions +parti4x4+parti8x8+partp8x8+partb8x8 -g 250 -keyint_min 25 -level 30 -qmin 10 -qmax 51 -qcomp 0.6 -trellis 2 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 2 -qdiff 4 -direct-pred 3 -wpredp 2 -rc_lookahead 50 -acodec libfaac -b:a 112k -ar 48000 -ac 2
MP4 Widescreen /
x264HQWS
-f mp4 -r 29.97 -vcodec libx264 -vf scale=704:384 -b:v 1250k -aspect 16:9 -flags +loop -cmp +chroma -deblock 0:0 -maxrate 1500k -bufsize 4M -bt 256k -refs 1 -bf 3 -coder 1 -me_method umh -me_range 16 -subq 7 -partitions +parti4x4+parti8x8+partp8x8+partb8x8 -g 250 -keyint_min 25 -level 30 -qmin 10 -qmax 51 -qcomp 0.6 -trellis 2 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 2 -qdiff 4 -direct-pred 3 -wpredp 2 -rc_lookahead 50 -acodec libfaac -b:a 112k -ar 48000 -ac 2
MPEG-4 H.264 video (high quality) /
MPEG4VideoHQ
-crf 35.0 -vcodec libx264 -acodec libfaac -ar 48000 -b:a 128k -coder 1 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me_method hex -subq 6 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 1 -qcomp 0.6 -qmin 0 -qmax 69 -qdiff 4 -bf 3 -refs 5 -direct-pred 3 -trellis 1 -wpredp 2 -rc_lookahead 50 -threads 0
MPEG-4 H.264 video (very high quality) /
MPEG4VideoVHQ
-crf 25.0 -vcodec libx264 -acodec libfaac -ar 48000 -b:a 160k -coder 1 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me_method hex -subq 6 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 1 -qcomp 0.6 -qmin 0 -qmax 69 -qdiff 4 -bf 3 -refs 8 -direct-pred 3 -trellis 2 -wpredp 2 -rc_lookahead 60 -threads 0
MPEG-4 H.264 video (super high quality) /
MPEG4VideoSHQ
-crf 15.0 -vcodec libx264 -acodec libfaac -ar 48000 -b:a 192k -coder 1 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me_method hex -subq 6 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 1 -qcomp 0.6 -qmin 0 -qmax 69 -qdiff 4 -bf 8 -refs 16 -direct-pred 3 -trellis 2 -wpredp 2 -rc_lookahead 60 -threads 0

Notes:

  1. WinFF has similar presets specific to Google Android transcoding.
  2. ffMPEG won’t accept filenames with special characters, such as diacriticals.

To decode the parameter names, see the ffMPEG documentation’s Options settings here.

Following are the video properties for PBS’s Nova: Building Pharaoh's Chariot episode:

image

The trimmed file has a net length of 00:52:39. Following are its video properties, as well as those for the five transcoded files, as reported by the free MediaInfo application:

Preset Format Profile Bitrate Max. Bitrate Display File Size
Source MPEG2 Main@High 11.9 Mbps 24 Mbps 1080i 4.8 GB
x264HQFS AVC High@L3.0 1.250 kbps 1,500 kbps 640x480p 526 MB
x264HQWS AVC High@L3.0 1,250 kbps 1,500 kbps 704x384p 526 MB
MPEG4VideoHQ AVC High@L5.0 990 kbps   1080p 433 MB
MPEG4VideoVHQ AVC High@L5.0 3,712 kbps   1080p 1.5 GB
MPEG4VideoSHQ AVC High@L5.1 16.0 Mbps   1080p 6.3 GB

Following are Wikipedia’s descriptions of the above H.264/MPEG-4 AVC levels with maximum property values:

image

It’s clear from the table above that Level 5.1 is overkill for 1080i (and probably 1080p) source video. It appears to be intended for the new super-high resolution TVs with 4096x2304 (2304p) resolution. MPEG4VideoVHQ, which creates files about 1/3 the source MPEG file size, should be adequate for viewing with tablets, as well as most HDTV sets.

Monday, January 14, 2013

Video Format Conversion from MPEG-2 to MPEG-4 Files for Microsoft Surface RT Tablets and Android Devices

Contents:

Update 1/14/2013: Added link to Ed Bott’s An inside look at Internet Explorer 10's mysterious Flash whitelist to the Adobe Flash Player Whitelist Tool for the Surface RT’s Metro Modern Browser section.

Update 1/13/2013: Added the Adobe Flash Player Whitelist Tool for the Surface RT’s Metro Modern Browser and Video Decoding and Format Capabilities of the UG007 Android 4.1 MiniPC Device sections.

Update 1/6/2013: Added a Transcoding Windows Media Center *.wtv files to MPEG-4 with Handbrake section. (Updated 1/7/2012.)

Update 1/3/2013: Added a Playing MPEG-4 H.264 Videos on a Google Nexus 7 Tablet (and other Android devices) section covering the Dice Video Player and Nexus Media Importer apps for Android.

Update 1/2/2013: Added a new Background section, as well as 1366 x 768 captures of original MPEG-2 broadcast and MPEG-4 HQ-WS transcoded versions of a Masterpiece Mystery “Poirot” episode to the Widescreen Video and Audio Quality Observations section.

Introduction

Background: In the late 1990s, I became interested in digital videography and purchased for about $2,500 a Sony DCR-VX1000 Mini-DV camcorder, which was the first video device to offer a FireWire (later IEEE-1394) digital output:
image_thumb9
imageI was a consultant to Adaptec Corp. for the AHA-8940, the first commercial consumer-oriented FireWire adapter for Wintel PCs, and was a contributor to Microsoft’s PC98 System Design Guide for DV-to-disk recording and editing under Windows 98. I also was a beta tester for early versions of Adobe Premiere video editing software for Windows.

I published the following two technical papers about the IEEE-1394 bus and DV recording/playback format, now archived on the OakLeaf Systems blog:

I also contributed numerous articles to DV Central’s Area 1394: Roger Jennings Reporting site, also archived by OakLeaf.


Unlike Windows 8’s Media Player, Microsoft Surface RT tablet computers don’t support HDTV’s (a.k.a. Advanced TV or ATV) MPEG-2 format. Instead, following are Surface RT’s supported video formats and codecs, according to the Brorsoft Web site:

image

Brorsoft mentions PressPlay Video by Apptivate.ms from the Windows Store, but this app only adds experimental support for Matroska (MKV) and Flash (FLV) video file formats to those above.

Transcoding with Free and OpenSource WinFF and ffMPEG Apps

Brorsoft resells a commercial video format conversion app (VideoConverter) for US$35.00, but there are numerous free video format conversion utilities for Windows, most of which are GUIs for the ffMPEG free command-line software. Here’s a screen capture of WinFF prepared to convert four sample MPEG-2 files, two of which are in 480P standard-definition (SD, 4:3 aspect ratio) and the other 1080P high-definition (HD, widescreen) formats:

image

WinFF offers the following preselected MPEG-4 conversion formats (Presets):

image

Here’s a screen capture of ffMPEG’s command window when starting a conversion of a MPEG-2 SD file to MPEG-4 Fullscreen:

image

The transcoding for MP4 Fullscreen is about 27 frames/sec (fps) on a moderate performance PC running Windows 7 Ultimate Edition, so it takes 29.97/27 = 1.15 times the playing time of the episode to perform the conversion.

For more information about ffMPEG and its codecs, see Wikipedia’s ffMPEG topic.

VideoLAN’s Forthcoming VLC Media Player

VideoLAN offers a free and open-source media player named VLC, which currently is available for Windows 8 on Intel and Windows 7, and is under development for the Windows 8 “modern” (formerly Metro) UI on ARM (Surface RT) with a Kickstarter-funded project that is 100+ percent funded as of 12/23/2012.

More details are available for the forthcoming VLC for the new Windows 8 User Experience ("Metro") version, including UI mockups. The target release date for the Windows Store doesn’t appear to be available from published information.

VLC for Windows 8 on Intel and Windows 7 plays the following formats:

image

It’s assumed that VLC will support the same formats on Surface RT tablets.

Note: A VLC beta version is available for Android, but isn’t compatible with Nexus 7 tablets.

Source of the MPEG-2 Test Files

The MPEG-2 source files for the following transcoded examples were recorded in MPEG-2 Transport Stream (*.ts) format from off-the-air broadcasts by KQED Public Television, the PBS station for the San Francisco Bay Area, with a Pinnacle PCTV HD80e USB HD Stick for Windows.

imageThe HD Stick is a USB 2.0 device with an adapter cable to convert the non-standard antenna input to a standard type F female coax connector. I bought several at a closeout price of US$30.00. The included TVCenter software provides a TVCenter Gallery app for transcoding from MPEG-2 Transport Stream to the following formats:

  • DVD (fails to transcode)
  • MPEG-2 Program Stream
  • MKV H264 Native
  • DivX, three formats
  • Sony PSP MPEG-4
  • Apple iPod MPEG-4 Low
  • Apple iPod MPEG-4 High
Obtaining MPEG-2, MPEG-4 and ATSC Video and Audio Format Data with MediaInfo

Digimetrics, a publisher of file-based test and measurement programs, sponsors distribution of MediaInfo, a free and open-source application that displays the most relevant technical and tag data for video and audio files. Following is MediaInfo’s basic properties Window for the SD “Dead Man’s Mirror” episode:

image

Note: The Advanced Television Standards Committee (ATSC) 704*480 format uses non-square pixels to achieve a 4:3 aspect ratio. ATSC allows the following video resolutions, aspect ratios, and frame/field rates:

  • 1920 × 1080 pixel (16:9, square pixels), at 30p, 29.97p, 24p, 23.976p, 60i, 59.94i.
  • 1280 × 720 pixel (16:9, square pixels), at 60p, 59.94p, 30p, 29.97p, 24p, or 23.976p
  • 704 × 480 pixel (4:3 or 16:9, non-square pixels), at 60p, 59.94p, 30p, 29.97p, 24p, 23.976p, 60i, or 59.94i
  • 640 × 480 pixel (4:3, square pixels), at 60p, 59.94p, 30p, 29.97p, 24p, 23.976p, 60i, or 59.94i

From Wikipedia’s MPEG-2 and ATSC Standards topics.

Here is the basic MediaInfo report for the two HD episodes:

image


Transcoding Standard Definition MPEG-2 to MPEG-4 H.264

Wikipedia describes the ATSC’s H.264/MPEG-4 format as follows:

H.264/MPEG-4 Part 10 or AVC (Advanced Video Coding) is a standard for video compression, and is currently one of the most commonly used formats for the recording, compression, and distribution of high definition video. The final drafting work on the first version of the standard was completed in May 2003.

H.264/MPEG-4 AVC is a block-oriented motion-compensation-based codec standard developed by the ITU-T Video Coding Experts Group (VCEG) together with the International Organization for Standardization (ISO)/International Electrotechnical Commission (IEC) joint working group, the Moving Picture Experts Group (MPEG). The product of this partnership effort is known as the Joint Video Team (JVT). The ITU-T H.264 standard and the ISO/IEC MPEG-4 AVC standard (formally, ISO/IEC 14496-10 – MPEG-4 Part 10, Advanced Video Coding) are jointly maintained so that they have identical technical content.

H.264 is perhaps best known as being one of the codec standards for Blu-ray Discs; all Blu-ray Disc players must be able to decode H.264. It is also widely used by streaming internet sources, such as videos from Vimeo, YouTube, and the iTunes Store, web software such as the Adobe Flash Player and Microsoft Silverlight, and also various HDTV broadcasts over terrestrial (ATSC, ISDB-T, DVB-T or DVB-T2), cable (DVB-C) and satellite (DVB-S and DVB-S2).

MPEG-4’s primary advantage is greater compression of the video source signal than MPEG-2, which reduces transmission bandwidth requirements. Other advantageous features are described here.

Transcoding with WinFF’s High Quality Preset

The following table compares the size of the original MPEG-2 and converted MPEG-4 files using the High Quality preset:

PBS Video Episode
Length
Format
MPEG-2 Size
MPEG-4 HQ
Compression
Dead Man’s Mirror
01:01:01
640 x 480
1,651,598 KB
124,332 KB
13.3:1
Jewel Robbery*
01:00:02
640 x 480
1,742,180 KB
133,045 KB
13.1:1
Appointment with Death
01:30:56
1920 x 1080
8,017,824 KB
565,326 KB
14.2:1
Mrs. McGinty Is Dead
01:31:00
1920 x 1080
6,874,432 KB
417,969 KB
16.4:1

* The full title is “Jewel Robbery at the Grand Metropolitan. 1020P.” 1080P files are from Masterpiece Mystery’s “Poirot X” and “Six by Agatha” series.

Note: Conversion with the Super High Quality preset produces exactly the same MPEG-4 file sizes, which indicates no quality benefit.

Video and Audio Quality Observations

Pixelation and motion-induced video noise with SD MPEG-2 input is more than most viewers would put up with on a 35-inch or larger HD TV. HD input improves picture quality and reduces noise, but doesn’t come close to broadcast standards.

Most viewers would find SD-HQ encoding delivers unacceptable video quality on a large-screen HD TV.

Audio quality doesn’t doesn’t suffer perceptible effects from transcoding.


Transcoding MPEG-2 to MPEG-4 H.264 Fullscreen and Widescreen Formats

Converting to MPEG-4 Fullscreen and Widescreen formats increases the resulting file size (compared to MPEG-4 HQ H.264 format).

Transcoding Standard Definition Files to MPEG-4 Fullscreen Format

Following are the details for the two SD files converted to MPEG-4 Fullscreen:

PBS Video Episode
Length
Format
MPEG-2 Size
MPEG-4 FS
Compression
Dead Man’s Mirror
01:01:01
640 x 480
1,651,598 KB
476,669 KB
3.46:1
Jewel Robbery
01:00:02
640 x 480
1,742,180 KB
477,149 KB
3.65:1

The transcoding rate is about 11 fps = 29.97/11 = 2.72 times the playing time.

image

Transcoding High-Definition Files to MPEG-4 Widescreen Format

Following are the details for the two high-definition files converted to MPEG-4 Widescreen:

PBS Video Episode
Format
MPEG-2 Size
MPEG-4 WS
Compression
Appointment with Death
1,920 x 1,010
8,017,824 KB
2,835,570 KB
3.14:1
Mrs. McGinty Is Dead
1,920 x 1,010
6,874,432 KB
2,093,443 KB
3.28:1

Here’s ffMPEG’s command window report upon completion of transcoding “Appointment with Death”:

image

Warnings ac-tex damaged at ## ## and Warning MVs not available are common. The effects usually are concealed by ffMPEG.

The transcoding rate is about 7 fps = 29.97/7 = 4.28 times the playing time.

image

Video and Audio Quality Observations

Motion-related pixelation, noise and other video artifacts, such as staircasing, are greatly reduced with HD-WS transcoding compared with SD-HQ (see image below) and to a lesser degree with HD-FS transcoding.

image

Overall, images are softer than with the original MPEG-2 source, giving what some would call a “film effect.” Most viewers would find HD-WS encoding to deliver acceptable video quality on a large-screen HD TV. Following is a 1366 x 768 (16:9) Surface RT screen capture from the introduction to the HD-WS version of Masterpiece Mystery’s “Poirot: Appointment with Death” episode, which demonstrates the “film effect”:

Poirot - Appointment with Death 1366x768

Here’s a nearby frame captured in 1,366 x 768 format on a laptop PC running Windows 7 Pro from the original 1920 x 1080 MPEG-2 1080P off-air from KQED-HD San Francisco:

Poirot

Audio quality doesn’t doesn’t suffer perceptible effects from transcoding.


Transcoding Windows Media Center *.wtv files to MPEG-4 with Handbrake

Windows Media Center records off-air video to files with a *.wtv extension. These files include series name (such as Check, Please! Bay Area), episode name (such as Bellanico, Davy Jones Deli, and Gamine), TV channel number and date/time recorded as metadata. Files are autonamed with SeriesName_Station_Year_Month_Day_Hour_Minute_Second, as in Check, Please! Bay Area_KQEDDT2_2013_01_02_00_30_00 for a program recorded from KQED Plus on 1/2/2013.

Handbrake, an open-source, GPL-licensed, multiplatform, multithreaded video transcoder, available for MacOS X, Linux and Windows, is capable of transcoding these files to MP4 H.264 Normal (FS) or High Profile (WS) format:

image

To reduce file size, Media Center reduces the image size to 704 x 480 pixels, as shown above, for an MPEG-2 1080P transmission stream (*.ts file). Unlike TS, MPEG2, and MPEG4 files, Windows Explorer doesn’t display *.wtv files’ horizontal and vertical image size in pixels.

image

Handbrake reports that it further reduces the display size to 629 x 352 pixels. Here’s what the help file says about the Picture page’s controls:

Picture Settings

The Picture Settings Inspector lets change how your video will look. It has two tabs, Size and Filters, as well as a button to bring up the Preview Window.

Size

The size tab deals with the dimensions of the video, as well as the closely related matters of cropping and anamorphic encoding.

Width and Height

The width and height boxes allow you to control the pixel resolution of the encoded video. The steppers increment up and down by increments of 16.

Keep aspect ratio

When Keep Aspect Ratio is checked, HandBrake will link the height and width so that the picture is never distorted from its original aspect ratio.

Cropping

Sometimes, movies have black lines on the sides. To get rid of the them, you crop the picture. HandBrake does this automatically. It chooses how to crop pretty well, but sometimes it doesn't catch everything. If this is the case, click the Custom cropping radio button. This will enable the 4 numerical fields below arranged in a T-shape. Each field controls the cropping for the corresponding side of the picture. The steppers increment by 2, because cropping works best with even numbers.

Anamorphic (PAR)

When this is enabled, HandBrake will encode anamorphically. giving you a bigger picture.

There are three different ways of doing anamorphic in HandBrake: strictly, loosely, and custom. In strict mode, the full resolution of the DVD is preserved exactly. As a result, the picture dimensions will be locked and the "Keep aspect ratio" box will be dimmed out. Loose mode will tweak the dimensions slightly so they divide evenly by 16, and allows scaling the width of the stored video. Custom mode is just that -- all settings are configurable by the user. When it is enabled, extra controls appear in the inspector.

Here’s MediaInfo’s report of a typical transcoded file:

image

Windows Explorer displays the frame size as 704 x 358 pixels, as reported in Handbrake’s Picture Size text boxes. This frame size with High Profile transcoding provides adequate video quality for 7- and 10-inch tablets, but not for large monitors or HDTV sets. Transcoding time is about 15 minutes for a 30-minute *.wtv segment.

Adobe Flash Player Whitelist Tool for the Surface RT’s Metro Modern Browser

imageMicrosoft misguidedly determined to protect Surface RT users from watching Adobe Flash videos not approved by the Redmond Vatican by creating a whitelist of apparently TV-G-rated sites for the Metro Modern brower.

imageEd Bott (@edbott) asked “In Windows 8 and especially on Windows RT, your ability to run Flash programs hosted on the web depends on whether a site is included on Microsoft's Compatibility View list. So what does it take to get added to that list? And what can you do if a favorite Flash-based site won't work?” in a deck for his An inside look at Internet Explorer 10's mysterious Flash whitelist article of 1/14/2013.

ie10-flash-whitelist

Adobe's Flash has taken its share of abuse over the past few years, both for its security risks and for its occasional impact on performance and battery life.

For the late Steve Jobs, Flash represented an opportunity to break with a very messy past, as he articulated in his infamous April 2010 post, Thoughts on Flash. That blunt message listed the six reasons why, in Jobs' words, "we do not allow Flash on iPhones, iPods and iPads."

Of course, Apple still allows the Flash plugin on its Macs running OS X, which means Apple customers get to choose between all or nothing when it comes to Flash support. The inability to play Flash content is one of the consistent complaints I still hear from iPad owners, nearly three years after the platform's release.

For Internet Explorer 10 on Windows 8 and Windows RT, Microsoft has tried to walk a delicate balancing act with Flash. The underlying theory is that Flash itself isn't evil. Instead, its bad reputation can be traced to the impact of poorly written Flash programs, which drain batteries and hog CPU resources, or malicious Flash content that exploits weaknesses in the Flash runtime to spread malware.

There are, in fact, many well-written Flash-based programs that behave like model citizens. So why should they be punished for the sins of a few bad actors?

That's the philosophy behind the Internet Explorer 10 Flash compatibility whitelist. Alas, it's not well documented, which is why I decided to write this post. …

Read more.

imageAlthough you can manually add domains to the whitelist XML file at C:\Users\[USER_NAME]\AppData\Local\Microsoft\Internet Explorer\IECompatData\iecompatdata.xml with a text editor, the Windows RT Whitelist Flash Tool created by Lorenzo Nugara (@TheNamesEnz; a.k.a. DroidKid at Neowin) simplifies the process. You can download the Windows RT Whitelist Flash Tool files from my Skydrive account.

image

From Enz’ Readme.txt file:

  • Current Version: 1.0 01/08/2013
  • Description: Tool that allows you to add any website to Microsoft’s Internet Explorer compatibility list, return to the default list, and import a custom list.
  • Option 1:
    • Will copy over a custom compatibility list that I have attached to the script, this list contains a ton of different websites.
    • It will then disable the option "download updated compatibility list from Microsoft" to prevent the list from being overwritten.
    • It will overwrite your current compatibility list!
    • Once the compatibility list has been copied over the script will then delete all of your browser cache, history, and cookies...
  • Option 2:
    • Will copy over the default compatibility list.
    • It will then enable the option "download updated compatibility list from Microsoft" to allow the list to be updated automatically by Microsoft.
    • It will overwrite your current compatibility list!
    • Once the compatibility list has been copied over the script will then delete all of your browser cache, history, and cookies...
  • Option 3:
    • Will prompt you to enter a website that you would like added to your compatibility list. Note: you MUST type the website without any prefixes such as "www" or "Http" for example if you wanted to add the website (www.miniclip.com) you would type miniclip.com
    • The script will then disable the option "download updated compatibility list from Microsoft" to prevent the list from being overwritten.
    • Once the web site has been added to you compatibility list the script will then delete all of your browser cache, history, and cookies...
  • Option 4: Will simply exit the script within 4 seconds or if you push any key

As Ed Bott observed:

I'm aware of at least one third-party solution that works by tweaking the built-in CV list with your own additions. The trouble with that option is that it requires shutting down automatic updates to the CV list. And with Microsoft adding 30 domains per day to that list, on average, you're likely to miss out on a useful addition sooner rather than later.


Playing MPEG-4 H.264 Videos on a Google Nexus 7 Tablet

imageThe Dice Video Player from INISOFT_DEV is a free hardware-accelerated video player with playback speed control for Android devices, including the Google Nexus 7. The Dice player claims to offer the following features:

  • Network Support: Windows Share, FTP and HTTP
  • Multiple audio tracks
  • Multiple subtitle tracks; external subtitles are also supported
  • Hardware acceleration
  • Formats: AVI, MOV, MKV, FLV, AVI, 3GP, 3G2, ASF, WMV, MP4, M4V, TS, MTP, M2TS ]
  • Video Codecs
    • Hardware: MPEG-4, H.264, H.263
    • Software: MPEG-4, H.264, RMVB, XVID, MS MPEG-4, VP6, H.263, MPEG-1, MPEG-2
  • Audio Codecs: DTS, AC3, AAC, Vorbis, FLAC, MP3, MP2, WMA
  • Playback speed control up to x2.0 with hardware acceleration; audio pitch correction support
  • Subtitle formats: SSA,SMI,SRT, VoBSub (beta); MKV/MP4 with embedded subtitles (supports Unicode and multibyte charsets)
  • Transports: HTTP, RTP/RTSP, HTTP Live Streaming, FTP, Windows Share (SMB/SAMBA via NFS/Network File System)

Here’s a screen capture from my Nexus 7 of the Dice app playing the same file as above from a 16 GB USB flash drive:

image

You can download and install the Dice Video Player from Google Play.

imageThe US$2.99 Nexus Media Importer from Homesoft enables streaming *.mp4 and other video and audio files from a USB Flash drive plugged into a USB On-The-Go (OTG) compatible cable or hub connected to an OTG cable. For more information on these cables for Android devices, see OakLeaf’s Get the Right On-The-Go (OTG) Micro-USB Cable for Nexus 7 Tablets post (updated 1/4/2013.)


Video Decoding and Format Capabilities of the UG007 Android 4.1 MiniPC Device

I’ve ordered a CozySwan UG007 Android 4.1 MiniPC device from Amazon (sold by VALI and fulfilled by Amazon) for US$69.50 (Prime 3-day freight included) based on James Threw’s The RK3066 Android 4.1 mini PC is the MK802's younger, smarter, cheaper brother, we go hands on Engaget review of 1/12/2013, which begins as follows:

imageWhen the MK802 Android mini PC landed in our laps, it caused more than a ripple of interest. Since then, a swathe of "pendroids" have found their way to market, and the initial waves have died down. While we were at CES, however, we bumped into the man behind the MK802, and he happened to have a new, updated iteration of the Android mini PC. Best of all, he was kind enough to give us one to spend some time with. The specifications speak for themselves, and this time around we're looking at a dual-core 1.6GHz Cortex A9, 1GB of RAM, 4GB of built-in flash (and a microSD slot), WiFi in b/g/n flavors, DLNA support and Bluetooth, all running on Android 4.1 Jelly Bean. There's also a micro-USB, full-size USB, female HDMI port and 3.5mm audio out. …

According to Amazon, the specs for the CozySwan unit (edited for clarity) are as follows:

  • imageOperating System: Google Android 4.1.1 Jelly Bean with Bluetooth
  • CPU: RK3066 1.6GHZ Dual ARM Cortex-A9 processor
  • GPU: Mali 400MP4 quad-core; supports 1080P video (1920 by 1080 pixels)
  • RAM: 1GB DDR3
  • Internal Memory: 8 GB Nand Flash
  • External Memory: Supports Micro-SD card, up to 32GB
  • Networking: WiFi 802.11b/g/n with internal antenna
  • Ports: 1 USB 2.0 host and 1 Micro USB host (see photo at right), 1 HDMI male, 1 Micro-SD card slot
  • Power: 90-230V, 50/60Hz, 30 W input to wall wart; output: 5V/2A
  • Video Decoding: MPEG 2 and 4.H.264; VC-1; Divx; Xvid; RM8/9/10; VP6
  • Video Formats: MKV, TS, TP, M2TS, RM/RMVB, BD-ISO, AVI, MPG, VOB, DAT, ASF, TRP, FLV
  • Audio Decoding: DTS, AC3, LPCM, FLAC, HE-AAC
  • Images: JPEG, PNG, BMP, GIF

Note: There are many similar first-generation devices, such as the MK802, which use the RK3066 CPU, run Android 4.0 and don’t support v4.1 or Bluetooth. Make sure you purchase a second-generation device.

Using a TV set as a monitor reminds me of the early days of the Commodore 64 and the first Apple PCs. Of course today’s HDTVs deliver the resolution for text and graphics that was missing in NTSC/PAL receivers.

I’ll update this post with video decoding and format compatibility details after I receive and test it with our Samsung UN46D6050 Smart TV.

Conclusion

As expected, transcoded MPEG video quality improves with increasing data rate (i.e., file-size). Transcoding from MPEG-2 to MPEG-4 H.264 to remedy a missing feature in a specific device probably doesn’t warrant the considerable time and effort required.

Transcoding directly from MPEG-2 Transport Stream to MPEG-4 H.264 Fullscreen or Widescreen is the best approach, because more device types and operating systems support this format.

If you have a large library of MPEG-2 files (I have 1.5 TB at the time of writing) and want to view them on a Surface RT, waiting for VideoLAN’s VLC Media player might be a practical alternative to MPEG-4 transcoding.


Saturday, January 12, 2013

Get the Right On-The-Go (OTG) Micro-USB Cable and Bluetooth Peripherals for Nexus 7 Tablets

Contents:

image
Update 1/12/2013: Added a Verifying Compatibility of USB and Bluetooth Peripherals for the UG007 Android 4.1 MiniPC Device section.
Update 1/10/2013: Added the Verifying Compatibility of Bluetooth Peripherals for the Nexus 7 section with headphone and keyboard tests and ASUS landscape dock for Nexus 7 announced at CES 2013 to a new Nexus 7 Docking Stations section.
Update 1/4/2013: You might need to enable USB Debugging (Settings | Developer Options |  Debugging | USB Debugging) to enable your Nexus 7’s OTG Host mode. You can tell if Host mode is enabled by an illuminated power LED on your USB hub.
Update 12/22/2012: I’ve tested the two low-cost USB-2 (Type A) to Micro-USB (Type B) converter cables discussed in this post and verified that they are OTG-compliant.

Introduction

imageI (@rogerjenn) purchased a 32-GB Nexus 7 tablet when Google made them generally available in late June 2012. My interest in the product stemmed from the desire to gain familiarity with the Android operating system without the need to enter into an extended cellphone contract (my wife and I are Verizon feature-phone customers with LG VX8360s on a low-cost plan) or pay a premium for an unlocked Android cellphone.

image_thumbUpdate 12/20/2012: Brooke Crothers asserted “Google is planning a Nexus 7 that could eventually go as low as $99, an Asia-based report claims” in a deck for his Google planning cheaper Nexus 7, report claims article of 12/19/2012 for CNet News, and noted:

Google and Asus are currently shipping about one million Nexus 7 devices per month, according to recent statements from Asus executives.

imageCurrently, I’m using the Nexus 7 to determine Android tablet compatibility of Office 365 SharePoint Apps with Visual Studio LightSwitch front ends autohosted in Windows Azure, as described in my LightSwitch HTML Client Preview 2: OakLeaf Contoso Survey Application Demo on Office 365 SharePoint Site post.

I was able to fast-charge the Nexus 7 with a D-Link DUB-H7 High Speed USB 2.0 7-Port Hub (powered, US$24.99) and gain access to the Nexus’s internal file system with the short male Type A USB 2.0 to male Micro-USB Type B charging cable:

image

Windows 7’s Windows Explorer connected to a Nexus 7 with a USB adapter cable

I later learned from the Reverend Kyle’s [VIDEO] Google Nexus 7 Tablet & OTG Cable for USB Host Connection article of 7/25/2012 on the XDA Developers Forum that the Nexus 7’s Micro-USB connector supported a limited repertoire of host-mode features, including support for USB keyboards and mice:

image

imageI have taken the time to connect an OTG (On The Go) cable into my Nexus 7 tablet to demonstrate for you how to take advantage of the USB Host capabilities of the device. You can plug in USB input devices such as a keyboard or a mouse, or both, with the use of a USB hub. You can also plug in a USB drive for extended data storage, as long as you download a free app from the Play Store called StickMount. Now, StickMount requires that your device is rooted, so if you have not done that yet, please follow my "Idiots Guide to Unlocking & Rooting your Nexus 7", located here: http://www.youtube.com/watch?v=sK9avekmA1c

Results may vary in terms of what USB devices work and what don't.

Note: I use HoneySoft’s Nexus Media Importer app (US$2.99) from the Google Play store to enable connecting USB drives and streaming video. This app eliminates the need to root your Nexus 7 and run StickMount.


A Misstep with a Micro-USB to Standard (Type A) USB Adapter

I wanted to try a conventional external keyboard and trackball with the device, so I purchased a male Micro-USB type B to female type A USB 2.0 adapter from my favorite local cable supplier, SFCable.com:

imageSFCable.com item number AD-USBAMCB-FM, $1.95 (plus shipping) - Not OTG-compliant

This was then (and still is) the only such adapter offered by SFCable.com. I wanted to use the adapter to connect an unpowered (passive) four-port USB hub for multiple human input-devices (HIDs):

imageSFCable.com four-port USB hub item number NET-ET-420BG, $8.95 (plus shipping)

When I received the adapter, plugged it into the Nexus 7 hub, the red power LED didn’t glow and the Nexus 7 didn’t recognize the connected keyboard and trackball. Directly connecting the keyboard or trackball didn’t work, either.

Note: Several Nexus 7 users/developers recommend plugging all the USB devices you plan to use in to the hub before plugging the hub in to the Nexus 7. I haven’t found this to be necessary.

Searching for Nexus 7 users with similar experiences led me to uberNoobZA’s The USB OTG [cables] that Do and DO NOT work with Nexus 7 Thread XDADevelopers post of 8/3/2012:

I realize there is another thread about an OTG cable that does work with the Nexus 7, but after 3 or 4 posts, it has digressed into discussing what to plug into the OTG and what to use instead of OTG.

As I struggled to find any confirmation of a device I could buy in the UK that DID work with the Nexus 7, I thought I'd make this thread. At the same time, I also bought a USB OTG adapter that does NOT work with the Nexus 7, so thought I'd let you know of that one too. I would like to request that people use this thread to show USB OTG's that they have confirmed as working with the Nexus 7 and also those that do not work.

For those OTGs that are working, please indicate what tests you have done as well as where you purchased it (links please). Please try to refrain from discussing / recommending devices to plug into the USB OTG unless it's to say you have confirmed it as working with the USG OTG and Nexus 7.

DOES work with Nexus 7:

image

Micro USB Host Mode On The Go OTG Cable for Nexus 7, Xoom, Galaxy S2, Nokia N810 / N900, Toshiba TG01, Archos G9 by FORPOWER from Amazon.co.uk, £1.69 (plus shipping)

I can confirm that the following work on the Nexus 7 with this Adapter:

  • USB Keyboard plugged into Adapter
  • USB mouse plugged into Adapter
  • USB mouse and USB keyboard plugged into (self powered) USB HUB, and HUB plugged into adapter
  • USB Memory Stick (pendrive as some call them) as long as the Nexus 7 and Google Nexus are ROOTED and have a utility called StickMount installed (from Google Play Store)
  • USB Dongle for Wireless Keyboard (with built in trackball), plugged into Adapter. Nexus 7 picks up both mouse and keyboard

Does NOT work With Nexus 7:
http://www.amazon.co.uk/gp/product/B...ls_o03_s00_i00

image

Ex-Pro® On-The-Go OTG USB HOST Cable for Archos Tablet 7 - Micro USB to Standard USB by Ex-Pro, £2.75 (plus shipping)

The above adapter appears similar, but not identical, to the SF Cable item.

All-in-all, I wasted about 2 hours and the cost of the adapter (plus shipping) due to not knowing SF Cable’s adapter wasn’t OTG-compliant. Hopefully, this post will save others similar lost time and expense.


Success with the U.S. Version of the FORPOWER OTG Cable

Following appears to be the equivalent to the FORPOWER cable for shipment from the U.S.:

image

EverydaySource Compatible with Google Nexus 7 Tablet Micro USB OTG to USB 2.0 Adapter by EverydaySource, US$1.03 (plus shipping)

The above cable, as well as the similar SANOXY Micro USB Host Mode OTG Cable Flash Drive SD T-Flash Card Adapter FOR Samsung GT-i9100 i9100 Galaxy S II 2 GT-N7000 Galaxy Note by SANOXY ($0.65 plus shipping) work well for me.

Tip: If your connected peripherals don’t work with one of the above adapter cables, you probably need to enable USB Debugging (Settings | Developer Options |  Debugging | USB Debugging) to enable your Nexus 7’s OTG Host mode. You can tell if Host mode is enabled by an illuminated power LED on your USB hub.


Divergence from Published Standards for OTG Connectors

Wikipedia’s Universal Serial Bus topic provides the following details about USB OTG connectors and receptacles:

USB On-The-Go Connectors

imageA USB On-The-Go device is required to have one, and only one USB connector: a Micro-AB receptacle. This receptacle is capable of accepting both Micro-A and Micro-B plugs, attached to any of the legal cables and adapters as defined in Micro-USB1.01.

The OTG device with the A-plug inserted is called the A-device and is responsible for powering the USB interface when required and by default assumes the role of host. The OTG device with the B-plug inserted is called the B-device and by default assumes the role of peripheral. An OTG device with no plug inserted defaults to acting as a B-device. If an application on the B-device requires the role of host, then the Host Negotiation Protocol (HNP) is used to temporarily transfer the host role to the B-device.

OTG devices attached either to a peripheral-only B-device or a standard/embedded host will have their role fixed by the cable since in these scenarios it is only possible to attach the cable one way around.

Host interface receptacles

image

The Nexus 7 and most other small devices with USB 2.0 that I’ve seen have Micro-B connectors, which theoretically restricts them to a peripheral-only type B device role.

Cable plugs (USB 1.x/2.0)

Cables exist with pairs of plugs:

image

Non-standard: Existing for specific proprietary purposes, and not interoperable with USB-IF compliant equipment.

In addition to the above cable assemblies comprising two plugs, an "adapter" cable with a Micro-A plug and a Standard-A receptacle is compliant with USB specifications.[25] Other combinations of connectors are not compliant. … [Emphasis added.]

The above “adapter” cable is what’s required by the specs, but all devices I’ve seen with Micro receptacles are Micro-B, not Micro-A types.

image

Note: Microsoft Surface tablets don’t share these issues because they provide a standard Type A receptacle.


USB Y-Cables for Charging Nexus 7 Devices While Using USB Peripherals

An XDA Developers Nexus 7 OTG + charging is here article of 10/13/2012 by mvmacd reports:

It says it's only been tested with CM10, but might also work with other ROMs. I finally got my Y cable, and I can confirm it works. [Using this cable from ebay, $6]:

image

Micro USB Host OTG Cable w/USB power S2 i9100 S3 i9300 i9220 i9250 Ships From US (US$9.99 with free shipping)

[Patch details:] http://mehrvarz.github.com/otg-power-nexus7.html

This means you can plug in your flash drive or hard drive and use it while on AC power!

I'm excited about this and I hope devs here can implement this into the Nexus 7 ROMs.

Check this patch to see how to implement into your kernel.

imageNote: Using this Y-cable requires unlocking your Nexus 7’s boot loader and replacing it with one of the two patches. I used Mark Skippen’s (@mskipxda) Asus Google Nexus 7 Toolkit v4.0.0 to unlock the boot loader and perform other operations on my Nexus 7.

I haven’t tested the ability of the above Y-cable to power peripherals, which requires testing it with Timur Mehrvarz’ Nexus 7 boot image that has external power and charging status enabled. I have verified that this cable is OTG-complaint.


Nexus 7 Docking Stations

Richard Lai (@richardlai) published ASUS Nexus 7 dock hands-on to the Engadget blog on 1/7/2013:

ASUS Nexus 7 dock handson

imageAlong with the Qube and the VivoTab Smart at CES, ASUS also quietly showed off its dock for the Nexus 7 at its remote suite outside CES. Judging by the tablet's position in the above photo, you can tell that the fairly weighty dock makes use of the tablet's [four pogo] pin connector [pads] towards the bottom of its left side. Swing to the back and you'll see a micro-USB port plus an audio-out socket.

imageThat's actually pretty much it for the dock, and there's no price or availability just yet for the US so we'll keep our eyes open for more detail. …

Read more: See all photos

Chris Welch’s Nexus 7 dock will be priced at $39.99 in US, to ship within two weeks (update) article of 1/10/2013 for The Verge also has a photo gallery.

Rumored MSRP is US$39.99 (UK£29.99) from B&H Photo-Video, where its expected to be in stock on 1/16/2013. A search on ASUS part number 90XB3XOKDS00020 shows several online stores offering the product since November 2012 but most showing “out of stock” currently.

Amazon lists several docking stations for the Nexus 7, but all hold the tablet in portrait mode and connect with a Micro-USB A male connector anchored in the base. As Lai notes, the ASUS dock takes advantage of the four undocumented pogo-pin connection pads on the bottom edge (left edge in portrait mode with USB connector at the bottom.) Presumably, you’ll be able to use one of the two Micro-USB connectors for charging with peripherals plugged into the other.

I assume the four pogo-pin pads correspond to the four USB conductors, but I wonder how they multiplex the analog stereo audio to the 3.5-mm connector.


Verifying Compatibility of Bluetooth Peripherals for the Nexus 7

imageNote: The native Nexus 7 kernel doesn’t support USB Audio, so my Plantronics USB headset doesn’t work with it. I bought a Logitech Wireless (BlueTooth) Headset from Amazon for US$32.98, which works well with the Nexus 7 and Surface RT.

imageI also purchased a GTMax K1280 Ultra Slim Full-Size Wireless Bluetooth Keyboard from Amazon for US$25.50 plus $4.99 shipping, which I found to work well with both the Nexus 7 and Surface RT. The keyboard is about the same size as the Surface Type keyboard but costs $100 less.

image

I’m still attempting to find a ordinary (not finger-sized) trackball with Bluetooth connectivity. No luck as of 1/10/2013.

Verifying Compatibility of USB and Bluetooth Peripherals for the UG007 Android 4.1 MiniPC Device

I’ve ordered a CozySwan UG007 Android 4.1 MiniPC device from Amazon (sold by VALI and fulfilled by Amazon) for US$69.50 (Prime 3-day freight included) based on James Threw’s The RK3066 Android 4.1 mini PC is the MK802's younger, smarter, cheaper brother, we go hands on Engaget review of 1/12/2013, which begins as follows:

imageWhen the MK802 Android mini PC landed in our laps, it caused more than a ripple of interest. Since then, a swathe of "pendroids" have found their way to market, and the initial waves have died down. While we were at CES, however, we bumped into the man behind the MK802, and he happened to have a new, updated iteration of the Android mini PC. Best of all, he was kind enough to give us one to spend some time with. The specifications speak for themselves, and this time around we're looking at a dual-core 1.6GHz Cortex A9, 1GB of RAM, 4GB of built-in flash (and a microSD slot), WiFi in b/g/n flavors, DLNA support and Bluetooth, all running on Android 4.1 Jelly Bean. There's also a micro-USB, full-size USB, female HDMI port and 3.5mm audio out.

imageFor anyone who has used one of these types of devices, the two standout features mentioned above should be the audio jack, and the addition of Bluetooth. Why? Because this expands the potential functionality of the device manyfold. Beforehand, the lack of Bluetooth made adding peripherals -- such as a mouse of keyboard -- either difficult, or impractical. However, with Bluetooth, setting up this device to be somewhat useful just got a lot easier. Likewise, with the dedicated audio out, now you can work with sound when the display you are connecting it to (a monitor for example) doesn't have speakers. Read on after the break to hear more of our impressions. …

image

According to Amazon, the specs for the CozySwan unit (edited for clarity) are as follows:

  • imageOperating System: Google Android 4.1.1 Jelly Bean with Bluetooth
  • CPU: RK3066 1.6GHZ Dual ARM Cortex-A9 processor
  • GPU: Mali 400MP4 quad-core; supports 1080P video (1920 by 1080 pixels)
  • RAM: 1GB DDR3
  • Internal Memory: 8 GB Nand Flash
  • External Memory: Supports Micro-SD card, up to 32GB
  • Networking: WiFi 802.11b/g/n with internal antenna
  • Ports: 1 USB 2.0 host and 1 Micro USB host (see photo at right), 1 HDMI male, 1 Micro-SD card slot
  • Power: 90-230V, 50/60Hz, 30 W input to wall wart; output: 5V/2A
  • Video Decoding:MPEG 2 and 4.H.264; VC-1; Divx; Xvid; RM8/9/10; VP6
  • Video Formats: MKV, TS, TP, M2TS, RM/RMVB, BD-ISO, AVI, MPG, VOB, DAT, ASF, TRP, FLV
  • Audio Decoding: DTS, AC3, LPCM, FLAC, HE-AAC
  • Images: JPEG, PNG, BMP, GIF

Note: There are many similar first-generation devices, such as the MK802, which use the RK3066 CPU, run Android 4.0 and don’t support v4.1 or Bluetooth. Make sure you purchase a second-generation device.

Using a TV set as a monitor reminds me of the early days of the Commodore 64 and the first Apple PCs. Of course today’s HDTVs deliver the resolution for text and graphics that was missing in NTSC/PAL receivers.

I’ll update this post with compatibility details after I receive and test it with our Samsung UN46D6050 Smart TV.