[CM7] Video Drivers : Play YouTube HQ Videos smoothly on CM7 [update 2, 19/01]
Video Drivers for Cyanogen 7 alpha7
I've been working on porting Galaxy S's libs for hardware video decoding to our beloved Galaxy 3, and here is the result !
What does it do ?
It allows video decoding for h264, h263 and mpeg4 encoded videos. Basically, YouTube HQ, Vimeo, Dailymotion videos, including 480p versions. Also .mp4 and .m4v files from SD Card.
What does it NOT do ?
It doesn't decode WMV9. It is not responsible for Audio/Video syncing. It is not responsible for auto rotation. AVI files don't play. It won't make you coffee.
Is there issues ?
Some h264 files played locally (from SD Card) may not work because the MFC device doesn't support h264 Profiles higher than Baseline.
Videos with resolution higher than 832x512 won't play, the MFC device doesn't support them.
When you paused a video, the screen went off, and you unlock the screen : the screen is black. Tap it, press play.
When you paused a video, and you're seeking through it, the picture doesn't change. It actually does the seeking, just press play.
What do I do if there a problem with a video ?
PM me with a link to the video, a description of the problem. Add the result of the following commands :
[CM7] Video Drivers : Play YouTube HQ Videos smoothly on CM7
How does it work ?
When you start your phone, stagefright (the piece of software that handles media playback/recording in Android), scans for files it knows. Here is a list for what it looks for:
If a file you want to play doesn't have one of these extensions, you'll need a third party player, like MX Video or QQPlayer.
When you open a file, lib stagefriht "sniffs" the file to know if it knows how to extract frames from it. For example, it doesn't know how to extract frames from .avi files, but does for .mp4
When it got a frame, it looks for a matching decoder, and goes for hardware ones if available. For example, it will find a decoder for mpeg4, but won't know what to do with xvid or divx.
For h264, MPEG4 and H263 it will use these libs to decode. Stagefright sends it the encoded frame, the lib copies it to the MFC input buffer, ask MFC to decode it, crop it if necessary, while copying the decoded frame to the output buffer.
Then stagefright displays it.
Now, about h264. There are several 'profiles', depending on the target device. Baseline for mobile devices, Main for computers, High for Blurays and HD-DVD.
Our phones can decode Baseline, not Main, not High. Many .mkv files out there use h264 with either Main or High profiles and thus won't be decoded.
Main and High use and different compression algorithm and add features the MFC don't know about and its initialization will fail.
To sum it up:
- .AVI, .FLV, .WMV and any other extension not listed above can't be opened without a third party software.
- All h264 encoded files can't be played, due to hardware limitations.
- The libs just decode the frame, it is not responsible for which frame is sent to it, for skipping frames, for aspect ratio, for A/V sync, for low content quality.
- It doesn't make kitten videos any funnier.
HTC One & Nokia 8800 Arte (Carbon Black) Retired: Motorola V3i, Nokia N91, Nokia 8800 Sirocco, Nokia N95, HTC Diamond, Sony Xperia X1, HTC HD, HTC HD2, iPhone 4, HTC Desire HD, HTC Sensation, HTC One X, HTC Butterfly! Follow Me
Laptop/PC: Spec: Old and VERY Slow Compaq CQ42-210AU with AMD V120 CPU @2.2GHZ, ATI Radeon HD 4250 GPU, 2GB RAM (1.7GB Usable).
OS: Windows 7 64 bit Home Premium SP1
XDA Developers was founded by developers, for developers. It is now a valuable resource for people who want to make the most of their mobile devices, from customizing the look and feel to adding new functionality. Are you a developer?