Codec-On-Demand Based on User-Level Virtualization
Total Page:16
File Type:pdf, Size:1020Kb
IEICE TRANS. INF. & SYST., VOL.E92–D, NO.12 DECEMBER 2009 2422 PAPER Codec-on-Demand Based on User-Level Virtualization Youhui ZHANG†a), Member and Weimin ZHENG†, Nonmember SUMMARY At work, at home, and in some public places, a desktop PC We performed a test to show the decoding capability is usually available nowadays. Therefore, it is important for users to be able of the mainstream media players. More than eighty video ff to play various videos on di erent PCs smoothly, but the diversity of codec files were selected randomly from the Internet to be played types complicates the situation. Although some mainstream media play- ∗ ers can try to download the needed codec automatically, this may fail for by five players, WMP 10.0 , RealPlayer 11, QuickTime 7.0, average users because installing the codec usually requires administrator MPlayer v1.0rc2 [1] and VLC 0.9 [2] on a freshly-installed privileges to complete, while the user may not be the owner of the PC. We Windows XP SP2 host. Each player tried to show all believe an ideal solution should work without users’ intervention, and need videos before it was uninstalled and the next player was in- no special privileges. This paper proposes such a user-friendly, program- transparent solution for Windows-based media players. It runs the media stalled and tested successively. Successful decoding meant player in a user-mode virtualization environment, and then downloads the that both the video and audio streams could be decoded needed codec on-the-fly. Because of API (Application Programming In- smoothly. The results were interesting: terface) interception, some resource-accessing API calls from the player will be redirected to the downloaded codec resources. Then from the view- • MPlayer behaved perfectly as it could decode all point of the player, the necessary codec exists locally and it can handle videos; the exception was that the audio streams of two the video smoothly, although neither system registry nor system folders files could not be handled. The runner-up was VLC: was modified during this process. Besides convenience, the principle of about 94% of the files could be decoded. least privilege is maintained and the host system is left clean. This pa- • per completely analyzes the technical issues and presents such a prototype WMP behaved not badly: more than 85% of the files which can work with DirectShow-compatible players. Performance tests were decoded smoothly; for RealPlayer, the success- show that the overhead is negligible. Moreover, our solution conforms to ful ratio was about 77%; QuickTime performed poorly: the Software-As-A-Service (SaaS) mode, which is very promising in the the ratio was only 30%. All players were configured as Internet era. key words: codec, user-level virtualization, on demand “downloading codec automatically”. It appears that the two open source players (MPlayer 1. Introduction and VLC) performed much better that their commercial counterparts. However, neither of them has the function to The number of videos that can be accessed through the In- download a needed codec automatically when an unknown ternet keeps on growing rapidly. As well, a desktop PC or video is met, which means that their extensibility is limited kiosk is usually available at work, at home, and in some and they are not very user-friendly. public places. However, how to play the ubiquitous videos For a skilled user, locating and installing a suitable conveniently on any PC is an open problem. That is, most codec or player is easy. However, for an ordinary user, it users may have an annoying experience: after waiting a long is difficult to understand the technical codec-related terms, time for a video to download, the user is informed that the let alone find and install it. video cannot be played because there is no suitable codec Moreover, in some computing environments, the user on the host. may be not the owner of the host and then she has to run Some mainstream video players have solutions for this players on a locked-down PC without the administrator priv- situation. For example, Windows Media Player (WMP) ilege, which means she cannot install any new software. can automatically download a suitable codec to play a new We believe an ideal solution should have the following video, and RealPlayer has the same function. However, be- features: cause of the diversity of codec types, they cannot solve this • User-friendliness. That is, the user need not know any- problem completely and the “cannot play” issue still arises thing about codec location, installation, and so on. No frequently. Therefore, there are some open-source play- administrator privilege is needed. ff ers famous for their capabilities to deal with many di erent • Program transparency. Current media players should codecs. not need to be rewritten to have the new feature. Manuscript received October 16, 2008. ∗The latest version is WMP 11. However, it does not Manuscript revised April 8, 2009. affect the credibility of our test because the new features of †The authors are with the Department of Computer Science WMP 11 are focused on the flexibility in managing functions and Technology, Tsinghua University, Beijing, 100084, China. as mentioned at http://www.microsoft.com/windows/windows- a) E-mail: [email protected] vista/features/media -player-11.aspx. It still needs administrator DOI: 10.1587/transinf.E92.D.2422 privilege to install an on-demand codec. Copyright c 2009 The Institute of Electronics, Information and Communication Engineers ZHANG and ZHENG: CODEC-ON-DEMAND BASED ON USER-LEVEL VIRTUALIZATION 2423 • High adaptability. At least for the mainstream media players on most desktop PCs, it should “just work”. 2. Related Work ffi The most di cult problem is to provide these features 2.1 On-Demand in a compatible way, so that the existing players and codecs can be reused. This paper presents such a solution. It On-demand is a feature which responds to the user’s desire enables the player software to run in a user-mode virtual- for instant gratification and immediate use. It is regarded as ization environment that intercepts some resource (registry, a friendly and economical service by IT users. Some types files/directories, environment variables, etc.) accessing API of on-demand service include: calls from the player to learn whether a suitable codec ex- ists on the local host or not. If needed, the codec is down- • Video-on-demand is a type of video or movie service loaded from the Internet into the same virtualization envi- which allows the viewer to access the media immedi- ronment. Subsequently the resource-accessing API calls are ately upon subscription, such as streaming Internet or intercepted and some of them will be redirected to the down- pay-per-view television offerings. loaded resource. • On-demand computing most frequently refers to a type Therefore, from the viewpoint of the media player, the of computing service where the actual software is pre- necessary codec is available and it can handle the video sented to the user, once a subscription to the service is smoothly. The key point is that, during the whole process, successfully processed. neither system registry nor system folder is modified. Thus, • On-demand software is typically delivered by an appli- the principle of least privilege [3] is maintained; in addition, cation service provider. This type of service offering is the host system is left clean, which minimizes the possibility also frequently referred to as Software as a Service. of conflicts between software. On the other side, our solution expresses some of the As mentioned in Sect. 1, although video-on-demand principles of SaaS; that is, the software can run on demand is a convenient service, users often encounter the “can- across the Internet without installation and without any spe- not play” problem because of the lack of a suitable codec. cial privilege; users’ intervention has been decreased to the Therefore it appears that combining video-on-demand with minimum. software-on-demand would be a smooth solution, which SaaS is believed as a promising delivery and us- means that a suitable codec could be automatically down- age mode for software, which was usually used by some loaded on demand with the video. This paper focuses on enterprise-level software and now it has moved closer to that idea. common users. The automatic download mechanism of Of course, online video-playback is also a popular WMP and RealPlayer can be regarded as a step to the mode. The most famous example is YouTube using Adobe software-as-a-service mode. But because they are based Flash technology [5] to provide the video streams. Adobe on the traditional DirectShow framework, their solution is Flash adopts a proprietary file format and its recent release not complete—the administrator privileges are still needed. supports H264 and AAC codecs. Users can watch videos in Our solution bridges the gap between the SaaS mode and this mode on diverse hosts because the Adobe Flash Player the legacy software (including codecs)—using the user-level and web browser plug-in are widely available. However, virtualization technology, we have implemented such a so- in this mode, existing videos have to be converted into the lution on the Windows OS, which can work successfully given format before delivery. Furthermore, it is unimag- with WMP, RealPlayer, some third-party players, and ex- inable that the online mode will totally replace the offline isting codecs; no source codes of them are modified. mode. This paper focuses on the offline mode of video play- back. Another mode, online, is becoming more and more 2.2 Multimedia Playback popular.