[CM7] Video Drivers : Play YouTube HQ Videos smoothly on CM7 [update 2, 19/01]

Search This thread

lebidou

Senior Member
Nov 30, 2010
122
331
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 :
Code:
adb logcat > logcatdump.txt
adb shell dmesg > dmesgdump.txt
adb shell ls -l /system/lib/ > systemlibdump.txt
NOTE: remove 'adb' and 'adb shell' if you're doing it from Terminal Emulator.


If you have any other questions, there is this thread.

Have a nice time playing videos on CM7!
 
Last edited:

lebidou

Senior Member
Nov 30, 2010
122
331
[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:
Code:
".mp3", ".mp4", ".m4a", ".3gp", ".3gpp", ".3g2", ".3gpp2",
        ".mpeg", ".ogg", ".mid", ".smf", ".imy", ".wma", ".aac",
        ".wav", ".amr", ".midi", ".xmf", ".rtttl", ".rtx", ".ota",
        ".mkv", ".mka", ".webm", ".ts", ".flac"
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.
 
Last edited:

lebidou

Senior Member
Nov 30, 2010
122
331
[CM7] Video Drivers : Play YouTube HQ Videos smoothly on CM7

Download Links

CWM Flashable :
MFC Drivers Update 2

Sources :
https://github.com/gaelph/MFC-Drivers-for-s5p6442

Revert Zip:
MFC Revert zip


Change Log

19/01/12 : Update 2 : Fixed a bug preventing h263 encoded videos to be played.

16/01/12 : Update 1 : Reworked the crop code, fixes 2 bugs where colors weren't displayed correctly. Also should save a nanosecond in computing.

15/01/12 : Initial Release.
 
Last edited:

GryTEcHoG

Senior Member
Jun 30, 2011
345
79
will this able to play files from sdcard instead of from youtube?


Can you upload the file again in some other sites since wupload.com is not working for me?
 
Last edited:

nanotechx

Senior Member
Oct 18, 2011
89
3
kolkata
awesome but a little problem

it seems to be working just fine but autorotation is not working.
please help anyone?
thanks.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 79
    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 :
    Code:
    adb logcat > logcatdump.txt
    adb shell dmesg > dmesgdump.txt
    adb shell ls -l /system/lib/ > systemlibdump.txt
    NOTE: remove 'adb' and 'adb shell' if you're doing it from Terminal Emulator.


    If you have any other questions, there is this thread.

    Have a nice time playing videos on CM7!
    30
    [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:
    Code:
    ".mp3", ".mp4", ".m4a", ".3gp", ".3gpp", ".3g2", ".3gpp2",
            ".mpeg", ".ogg", ".mid", ".smf", ".imy", ".wma", ".aac",
            ".wav", ".amr", ".midi", ".xmf", ".rtttl", ".rtx", ".ota",
            ".mkv", ".mka", ".webm", ".ts", ".flac"
    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.
    29
    [CM7] Video Drivers : Play YouTube HQ Videos smoothly on CM7

    Download Links

    CWM Flashable :
    MFC Drivers Update 2

    Sources :
    https://github.com/gaelph/MFC-Drivers-for-s5p6442

    Revert Zip:
    MFC Revert zip


    Change Log

    19/01/12 : Update 2 : Fixed a bug preventing h263 encoded videos to be played.

    16/01/12 : Update 1 : Reworked the crop code, fixes 2 bugs where colors weren't displayed correctly. Also should save a nanosecond in computing.

    15/01/12 : Initial Release.
    17
    Unexpectedly solved the sound issue, and another "pixelation" issue at the same time. How come they were related remains a mystery to me...
    The new (and hopefully last) problem is 176x144 videos not playing, and that will surely annoy a bunch of people.

    EDIT: small video bug fixed. Everything seems to work nicely. Checked H263 too, it's ok, videos with crop on the right side work too, I couldn't find something that didn't play!
    system_server still uses between 30 and 50% of cpu which is a bit high. At 200Mhz with performance governor, framerate didn't go lower than 20fps, it's still watchable.
    I'll remove some unecessary log output, clean up some code and prepare an update zip ASAP.

    I'm so glad this is over!
    15
    Good news, with latest OpenFIMG libs, hardware rendering seems to work! (No more headackes over this !)
    But don't go crazy about it just now, there's is still a bunch of stuffs to do:
    I have trouble with pbuffers (white bootanim, gallery and camera crashes, among other bugs)
    Rotation is ter-ri-ble.
    Output isn't double buffered as the rest of the pipeline.
    Framebuffer config is done by the libs, should be done in kernel.
    I'm still using fb1 as default fb, should be fb0, fb1 being setup dynamically to avoid useless memory consumption.

    And there might be other things that'll come up later as allways. I tryed using Samsung's OpenGL libs and it doesn't work (black screen from boot, fimc unusable, no errors in log to debug issues).

    You'll get more news as I fix some new stuff.