[DEV] Possibility of h264 720p high profile playback on Tegra2 -EDIT

Search This thread

AndroidON

Senior Member
May 10, 2011
209
533
Cheongju-si
Currently, tegra2 devices have problem on h264 playback.

But, Optimus 2x updated their firmware and enabled it.

I am using Atrix and wanted to play h264 on my phone.

Of course DICE player can hardware accelerate it but not by streaming flash.

And other players still have problem.

I did a test on several movies and found a interesting thing.

High profile movies are not really different from baseline profile movies.


Here's some example.
http://dl.dropbox.com/u/52685869/CES-News First Look on Samsung Galaxy Tab 11.6.mp4
http://db.tt/ULTADHdo

These two files are exactly same movie file exept profile info on file's header.
(I didn't reencoded it!)
I've downloaded this from youtube and just changed the movie file.
So upper one is just a copy of youtube 720p h264 high profile,
and bottom one is same file except I modified profile info to baseline.


If you play upper one from tegra device, it says file cannot be hardware accelerated or not supported.
But, bottom one can be hardware acceerated and played on android stock player.


So the idea is, if we can change the profile detection method of android,
tegra2 will try to support hardware accelrate on more files.
Maybe even youtube 720p can be streamed on tegra2!

I've searched through android source and found this.

2405581106.png


This is from https://github.com/Atrix-Dev-Team/a...gingerbread/media/libstagefright/OMXCodec.cpp


Since I am completely out of programming things,

I can't modify these codes. But somebody should be able to do this.

Help me please!:D


EDIT- Adding method what I tried on changing profile.

I used HEX editor, HxD to modify movie file's profile.

You can get it form here : http://mh-nexus.de/en/downloads.php?product=HxD

1. Open the h264 file on HxD

2. Press Ctrl + F and search for 'avcc'

3. You will see like this.

work4.png


4. You can find '64 00 1F' near from digits of 'avcc'.

※ 42 E0 – for Baseline Profile
4D 40 – for Main Profile
58 A0 – for Extended Profile
64 00 - for High Profile
1F (31 in dec) is level 3.1
29 (41 in dec) is level 4.1
33 (51 in dec) is level 5.1

So the '64 00 1F' means 'High profile 3.1'

5. Change the '64 00' to '42 E0'

6. Save the file. (HxD automaticaly creates backup file. So you have to disable it in setting if you don't want.)



So you can test this method for your own movie file.

But I hope someone make some edit on android source for this so everyone can enjoy it. :)
 
Last edited:

ycavan

Senior Member
Nov 9, 2007
412
300
Interesting.. Dice is the only player that plays it in hw mode. Doesn't play at all in android player for me.

Still hw accelerated playback for mp4 if cool. :D

Sent from my MB860 using XDA App
 

crossxn

Senior Member
Nov 2, 2010
193
25
Once again you come up with a cool mod :) Thank you.

Sent from my MB860 using Tapatalk
 

njarun

Senior Member
Sep 27, 2011
162
46
35
Kottayam
awsome work.....thanks once more....

btwn,, mx video player has got some good playback ablities. i usually decode video using hardware and ac3 or other unsupported audio codecs with s/w decoder. thanks to the dev....
 

Notorious544d

Senior Member
Aug 18, 2011
2,104
2,370
London
Heads up

@OP

I realise that you must be spending a lot of time 'finding' things when you make these mods.

Do you use 'Examdiff Pro?' It's an awesome tool that compares two files and highlights all the edited files. Clicking on the edited files will open the .txt/.xml/etc and all changes will be highlighted either side.

There's a 30 day trial, but it's absolutely awesome IMO.

It's worth at least a look.
 

AndroidON

Senior Member
May 10, 2011
209
533
Cheongju-si
@OP

I realise that you must be spending a lot of time 'finding' things when you make these mods.

Do you use 'Examdiff Pro?' It's an awesome tool that compares two files and highlights all the edited files. Clicking on the edited files will open the .txt/.xml/etc and all changes will be highlighted either side.

There's a 30 day trial, but it's absolutely awesome IMO.

It's worth at least a look.

Thanks. I'll try that :D

Sent from my MB860 using XDA App
 

AndroidON

Senior Member
May 10, 2011
209
533
Cheongju-si
So no one can help with this?

That's disappointing...

I'm tring to modify source but just ends with compile error on Ubuntu.

Need help of people who can do some *programming* :D

Sent from my MB860 using XDA App
 

crnkoj

Senior Member
Feb 16, 2011
1,844
398
Very nice developement, sadly i have no real programming skills either, so no idea how to help with this. Do you know how the optimus supports high profile (i mean as to what method they used)?
 

akmalhisyam

Senior Member
Jan 7, 2011
68
13
nice findings! I've tried it and able to play hd videos on my atrix..

p/s: can't we just do modification like this to the code?
Code:
static const char *AVCProfileToString(uint8_t profile) {
    switch (profile) {
        case kAVCProfileBaseline:
            return "Baseline";
        case kAVCProfileMain:
            return "Baseline";
        case kAVCProfileExtended:
            return "Baseline";
        case kAVCProfileHigh:
            return "Baseline";
        case kAVCProfileHigh10:
            return "Baseline";
        case kAVCProfileHigh422:
            return "Baseline";
        case kAVCProfileHigh444:
            return "Baseline";
        case kAVCProfileCAVLC444Intra:
            return "Baseline";
        default:   return "Unknown";
    }
}
 
1

1chris89

Guest
I can playback 720p and 1080p .mp4s on my Motorola Atrix 4G without the slightest problem at all. If you interested in exactly how to do this I can show you how. The only problem is on cm7 roms u can't send 1080p to a tv via hdmi yet. If your running a blur rom with the 1080p hdmi landscape mod you could watch intensely unbelievably high quality 1080p bluray quality .mp4 files from your phone. It can handle like 20Mbps or more I think. The only limitation is the FAT32 Filesystem limit. So your movies will be limited to 4GB however they look f*ing insane anyway and your playing them back on your phone! I love blowing away my friends with my phone. The motorola atrix is an F*ing POWERHOUSE!

Later

*BY THE WAY* If your interested I can upload a short clip of 1080p that can be played back beautifully in HW using MX Video Player. Please let me know how blur rom's work via hdmi to TV with the 1080p landscape mod! That would blow my damn mind if I could use my phone as a BluRay player. It sucks CM7 is limited to portrait 960x540 over hdmi. Also the FAT32 limit isn't so bad because if u have a 32GB Class 10 SD Card like me, you can put a couple stunning full length 1080p blurays at 4GB a piece. The main limit is in the bitrate because of the 4GB limit. If a 64GB class 10 comes out I'd jump on it. Also when are we going to upgrade to "Today's standards" as NTFS format on Android. Is it a linux limitation for FAT32 or something?

CYA
 
Last edited:

AndroidON

Senior Member
May 10, 2011
209
533
Cheongju-si
Very nice developement, sadly i have no real programming skills either, so no idea how to help with this. Do you know how the optimus supports high profile (i mean as to what method they used)?

I don't know either.
I think they used similar way or patched their driver to nvidia newest one.
I saw several changes from nvidia git.

nice findings! I've tried it and able to play hd videos on my atrix..

p/s: can't we just do modification like this to the code?
Code:
static const char *AVCProfileToString(uint8_t profile) {
    switch (profile) {
        case kAVCProfileBaseline:
            return "Baseline";
        case kAVCProfileMain:
            return "Baseline";
        case kAVCProfileExtended:
            return "Baseline";
        case kAVCProfileHigh:
            return "Baseline";
        case kAVCProfileHigh10:
            return "Baseline";
        case kAVCProfileHigh422:
            return "Baseline";
        case kAVCProfileHigh444:
            return "Baseline";
        case kAVCProfileCAVLC444Intra:
            return "Baseline";
        default:   return "Unknown";
    }
}

I thought about that.
But I can't test it because my Ubuntu just giving me some error while compiling.
Anyway thanks for you reply.

I'm not a programmer, but there is a camera.apk mod out there for the optimus 2x, maybe this is a place to start/port for atrix?

http://android.modaco.com/topic/343...tchen/page__st__2560__p__1849807#entry1849807

It is not a OS level modification.
Maybe atrix's camera app can be modified like it too.
I think it is not really difficult.
But thanks for your information.

I can playback 720p and 1080p .mp4s on my Motorola Atrix 4G without the slightest problem at all. If you interested in exactly how to do this I can show you how. The only problem is on cm7 roms u can't send 1080p to a tv via hdmi yet. If your running a blur rom with the 1080p hdmi landscape mod you could watch intensely unbelievably high quality 1080p bluray quality .mp4 files from your phone. It can handle like 20Mbps or more I think. The only limitation is the FAT32 Filesystem limit. So your movies will be limited to 4GB however they look f*ing insane anyway and your playing them back on your phone! I love blowing away my friends with my phone. The motorola atrix is an F*ing POWERHOUSE!

Later

*BY THE WAY* If your interested I can upload a short clip of 1080p that can be played back beautifully in HW using MX Video Player. Please let me know how blur rom's work via hdmi to TV with the 1080p landscape mod! That would blow my damn mind if I could use my phone as a BluRay player. It sucks CM7 is limited to portrait 960x540 over hdmi. Also the FAT32 limit isn't so bad because if u have a 32GB Class 10 SD Card like me, you can put a couple stunning full length 1080p blurays at 4GB a piece. The main limit is in the bitrate because of the 4GB limit. If a 64GB class 10 comes out I'd jump on it. Also when are we going to upgrade to "Today's standards" as NTFS format on Android. Is it a linux limitation for FAT32 or something?

CYA

Would you tell me how can we play HD files on Atrix?
It would be so great to do like that without reencode.
It is the final goal of this thread.
 
1

1chris89

Guest
Sure. Yes. No need to do any development. The atrix is fully capaple of decoding some jaw dropping stunning and unbelievable 1080p BluRay quality movies without any problem at all. It can also carry over DTS 5.1 to your receiver if you want. Ok so the key to decoding 1080p on the attrix lies within Xilisoft Video Converter Ultimate (I'm using Version 6.0). I can tell you exactly what profile and settings to use. What I want to do is upload a clip of 1080p footage so u guy's can have your minds blown by it. It can be decoded with MX Video Player without a problem @ 1920x1080 @ 20Megabits or more. However the FAT32 filesystem 4GB limit limits a typical full length BluRay to 3Mbps. Which honestly look f*ing insane still! I'm trying to find a way to upload a file on here. What's the file size limit? Like 10MB max or something?

Later

*I UPLOADED THE 1080P BLURAY SAMPLE CLIP* YAY ;P
 
Last edited:

AndroidON

Senior Member
May 10, 2011
209
533
Cheongju-si
Sure. Yes. No need to do any development. The atrix is fully capaple of decoding some jaw dropping stunning and unbelievable 1080p BluRay quality movies without any problem at all. It can also carry over DTS 5.1 to your receiver if you want. Ok so the key to decoding 1080p on the attrix lies within Xilisoft Video Converter Ultimate (I'm using Version 6.0). I can tell you exactly what profile and settings to use. What I want to do is upload a clip of 1080p footage so u guy's can have your minds blown by it. It can be decoded with MX Video Player without a problem @ 1920x1080 @ 20Megabits or more. However the FAT32 filesystem 4GB limit limits a typical full length BluRay to 3Mbps. Which honestly look f*ing insane still! I'm trying to find a way to upload a file on here. What's the file size limit? Like 10MB max or something?

Later

You can upload it to dropbox and link it to here.
Or use multiupload.

Edit- Wait, so what you want to say is.....reencoding?
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 21
    Currently, tegra2 devices have problem on h264 playback.

    But, Optimus 2x updated their firmware and enabled it.

    I am using Atrix and wanted to play h264 on my phone.

    Of course DICE player can hardware accelerate it but not by streaming flash.

    And other players still have problem.

    I did a test on several movies and found a interesting thing.

    High profile movies are not really different from baseline profile movies.


    Here's some example.
    http://dl.dropbox.com/u/52685869/CES-News First Look on Samsung Galaxy Tab 11.6.mp4
    http://db.tt/ULTADHdo

    These two files are exactly same movie file exept profile info on file's header.
    (I didn't reencoded it!)
    I've downloaded this from youtube and just changed the movie file.
    So upper one is just a copy of youtube 720p h264 high profile,
    and bottom one is same file except I modified profile info to baseline.


    If you play upper one from tegra device, it says file cannot be hardware accelerated or not supported.
    But, bottom one can be hardware acceerated and played on android stock player.


    So the idea is, if we can change the profile detection method of android,
    tegra2 will try to support hardware accelrate on more files.
    Maybe even youtube 720p can be streamed on tegra2!

    I've searched through android source and found this.

    2405581106.png


    This is from https://github.com/Atrix-Dev-Team/a...gingerbread/media/libstagefright/OMXCodec.cpp


    Since I am completely out of programming things,

    I can't modify these codes. But somebody should be able to do this.

    Help me please!:D


    EDIT- Adding method what I tried on changing profile.

    I used HEX editor, HxD to modify movie file's profile.

    You can get it form here : http://mh-nexus.de/en/downloads.php?product=HxD

    1. Open the h264 file on HxD

    2. Press Ctrl + F and search for 'avcc'

    3. You will see like this.

    work4.png


    4. You can find '64 00 1F' near from digits of 'avcc'.

    ※ 42 E0 – for Baseline Profile
    4D 40 – for Main Profile
    58 A0 – for Extended Profile
    64 00 - for High Profile
    1F (31 in dec) is level 3.1
    29 (41 in dec) is level 4.1
    33 (51 in dec) is level 5.1

    So the '64 00 1F' means 'High profile 3.1'

    5. Change the '64 00' to '42 E0'

    6. Save the file. (HxD automaticaly creates backup file. So you have to disable it in setting if you don't want.)



    So you can test this method for your own movie file.

    But I hope someone make some edit on android source for this so everyone can enjoy it. :)
    2
    Heads up

    @OP

    I realise that you must be spending a lot of time 'finding' things when you make these mods.

    Do you use 'Examdiff Pro?' It's an awesome tool that compares two files and highlights all the edited files. Clicking on the edited files will open the .txt/.xml/etc and all changes will be highlighted either side.

    There's a 30 day trial, but it's absolutely awesome IMO.

    It's worth at least a look.
    1
    You are awesome!
    1
    Besides there are 64gb cards called sdxc, but they are not compatible with the phone, so nothing above 32gb will be compatible with this phone, since sdxc is another standard and needs more pins.
    http://xdaforums.com/showthread.php?t=1433246

    I wouldn't try telling this guy that his 64GB card isn't working in his Atrix. ;)
    1
    May related with decoding but not profiles...


    Sent from my MB860 using XDA App

    Did some modification on omxcodec.cpp but no difference.

    I think Atrix have another method to recognize profile. :(

    Need more experiment....

    Anyway you can use video file modification method until then hehe.


    Sent from my MB860 using XDA App