[MOD] Video Bitrate Control (20-50mbps vs 10mbps stock) **NOW with demo link***

Search This thread

CouttsPhotog

Senior Member
Feb 2, 2011
50
25
flickr.com
I was tinkering with media_profiles.xml yesterday and it appears that modifying the bitrate settings in here affects the camera. The stock bitrate min/max values are:

min: 64000
max: 12000000

Videos shot with these settings are usually 6-10mbps bitrate. I have changed these values to:

min: 35000000
max: 60000000

And my videos are now between 20mbps and 50mbps (huge leap!). The file sizes are bigger but I'm assuming this has to mean the videos will be somewhat better quality (my guess is mostly in low light when the ISO is cranked higher). I don't understand very well how these values are all used in here, but adjusting the bitrate ones does make a difference. Although framerate for 1080p says 30 here, they always come off camera at 24fps so I'm not sure if framerate (or any other changes) will work here.


Any value higher than 60000000 for the max will cause the camera app to crash, so I think this is a good max for now. This mod has been done on countless other devices, so I'm in no way discovering anything new, I just decided to poke around and see what changes work :)


Here's some more details for what to modify (to apply this mod to 720p and 1080p):

Starting at line 127:
Code:
        <EncoderProfile quality="720p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   [COLOR="Red"][b]bitRate="60000000"[/b][/COLOR]
                   width="1280"
                   height="720"
                   frameRate="30" />
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

        <EncoderProfile quality="1080p" fileFormat="mp4" duration="30">
            <Video codec="h264"
                   [COLOR="red"][b]bitRate="60000000"[/b][/COLOR]
                   width="1920"
                   height="1080"
                   frameRate="30" />
            <Audio codec="aac"
                   bitRate="96000"
                   sampleRate="48000"
                   channels="1" />
        </EncoderProfile>

And one other spot, line 340:
Code:
    <VideoEncoderCap name="h264" enabled="true"
        minBitRate="[COLOR="red"][b]35000000[/b][/COLOR]" maxBitRate="[COLOR="red"][b]60000000[/b][/COLOR]"
        minFrameWidth="176" maxFrameWidth="1920"
        minFrameHeight="144" maxFrameHeight="1080"
        minFrameRate="15" maxFrameRate="30" />



Additional mod:
People have claimed on other devices changing this setting produces higher quality images from the camera, starting at line 216:
Code:
        <ImageEncoding quality="[COLOR="red"][b]100[/b][/COLOR]" />
        <ImageEncoding quality="80" />
        <ImageEncoding quality="70" />
        <ImageDecoding memCap="20000000" />





Steps to apply the mod:
1) have ADB setup and working (not explaining that here, plenty of other threads for this)
2) cd to some directory to work in (I just use the desktop), ensure ADB is in your path (google that part)
3)
Code:
adb pull /etc/media_profiles.xml .
to pull the media_profiles.xml file to whatever folder you're in with the terminal.
4) Make your modifications, save the file (maybe keep a backup of the original file if you want).
--- workaround because adb remount doesn't work] ---
5)
Code:
adb push media_profiles.xml /sdcard/download
6) Use root explorer to move the media_profiles.xml file from your downloads folder to the /etc folder (make sure to mount /etc as R/W before you try to move).
7) Reboot phone, all set!

EDIT
- or just use Root Explorer (available in the market) to do the changes, reboot the phone and you're done!


edit
Demo video shot at 45mbps:
http://www.youtube.com/watch?v=J2r6zPYlRD0

http://www.youtube.com/watch?v=XCbNs1hEEjU


Hope somebody else finds this as useful as me!
 
Last edited:

fiveoh

Senior Member
Aug 2, 2010
53
0
You can also use soemthing like Root Explorer to make these changes directly on the phone.

Change the directory to R/W
Long press on the file and when the menu pops up, select Open with Text editor.

Make your changes

Save and exit.

Make sure the permissions are RW R R

Pull the battery and reboot.
 

deyna

Senior Member
Dec 14, 2010
94
9
Hernando, MS
This man knows what's up. Especially since I'm on the toilet right now :D

Sent from my Galaxy Nexus using xda premium

[OT]now I'm wondering if I should be too[/OT]

Have you tried taking two videos that are as close to identical as possible, one with the stock settings and the other with the mod? That would show if it effects the quality at all.
 
Root Explorer Method

I just used the 'RE' method and it worked just fine [MAKE SURE TO TOGGLE RW, LONG-PRESS ON FILE, OPEN IN TEXT EDITOR, MAKE MOD's (BE CAREFUL TO MAKE SURE YOU'RE MOD'ing EXACTLY WHAT'S IN THE OP !!) THEN SAVE CHANGES & EXIT > AFTER THAT, HOPEFULLY WE PROFIT :cool:

... however, I cannot comment on the difference the modifications have made. If the OP is correct in his research, then I can't see why this MOD wouldn't be a PLUS !
BTW, Just to be SAFE, I moved a copy of my unmodified media_profiles.xml to my sdcard ... 'RE' will automatically create a .bak file when changes are made, but im extra cautious when modifying certain system files that I haven't dealt with before .... better safe than sorry, they say :rolleyes:;)
 
  • Like
Reactions: Mustang302LX

CouttsPhotog

Senior Member
Feb 2, 2011
50
25
flickr.com
Glad to see some replies! :)

I haven't done an exact side by side test yet, but typically higher bitrate will produce better quality gradients in videos (things like smoke, color changes in walls, etc) and should be especially noticeable in low light video where the ISO is very high.

I got the idea because I was a developer of Magic Lantern for a while this past year, and one of the great features it adds to canon dslr cameras is the ability to raise the bitrate (from 25mbps or so up to almost 80mbps), and makes a huge difference in quality.

Generally things with high complexity cause it to shoot at a higher bitrate as well (since it is a variable bitrate, it changes). Examples would be trees with lots of tree branches and stuff.

I'll try to get a comparison up later this week, I'm still waiting for my macbook pro to be shipped back from applecare.




---
I just shot a video walking around outside and it ended up being 45mbps. I can't upload though, youtube is having some issues.. will try again later today and post it here.
 
Last edited:
  • Like
Reactions: nexus.prime

jamdev12

Member
Nov 7, 2010
30
4
Glad to see some replies! :)

I haven't done an exact side by side test yet, but typically higher bitrate will produce better quality gradients in videos (things like smoke, color changes in walls, etc) and should be especially noticeable in low light video where the ISO is very high.

I got the idea because I was a developer of Magic Lantern for a while this past year, and one of the great features it adds to canon dslr cameras is the ability to raise the bitrate (from 25mbps or so up to almost 80mbps), and makes a huge difference in quality.

Generally things with high complexity cause it to shoot at a higher bitrate as well (since it is a variable bitrate, it changes). Examples would be trees with lots of tree branches and stuff.

I'll try to get a comparison up later this week, I'm still waiting for my macbook pro to be shipped back from applecare.




---
I just shot a video walking around outside and it ended up being 45mbps. I can't upload though, youtube is having some issues.. will try again later today and post it here.

Thanks for the MOD. Since I like modding as well, I've put this into Axi0m2.3 and saved as a personal Clockwork image. Only thing that I notice is that since my sdcard file system is fat32, I can only capture about 5 minutes worth of video. I'll have to check out the difference as well and either format my sdcard ext4 or disable the mod.

Thanks again for the tweaks.
 

CouttsPhotog

Senior Member
Feb 2, 2011
50
25
flickr.com
Thanks for the MOD. Since I like modding as well, I've put this into Axi0m2.3 and saved as a personal Clockwork image. Only thing that I notice is that since my sdcard file system is fat32, I can only capture about 5 minutes worth of video. I'll have to check out the difference as well and either format my sdcard ext4 or disable the mod.

Thanks again for the tweaks.

Awesome. I have edited the OP to include a youtube link to a demo video I just shot, make sure to check it for me (I can't play HD videos on this computer, I'm curious how it looks on youtube).

That is the only problem, the higher bitrate will cause all videos to be quite a bit larger. The video I just uploaded to youtube was 262mb.


Another note on fat32: a limit of the FAT filesystem is that it has a file size limit of 4gb, so that could be an issue we run into (people trying to record longer videos).

Also this mod could be problematic for phones other than the Galaxy Nexus which use an internal SD card. Read/Write speed for the card limits bitrate a lot. Luckily the g nexus has internal memory though which is very fast, so it shouldn't be an issue for us.
 

christianpeso

Senior Member
Sep 20, 2007
1,202
534
Video looks good to me. Just changed my media file to your setting. Will try out today when I go out. Need some comparison videos of the same scene with stock settings and then yours.
 

nic85

Senior Member
Feb 5, 2009
2,137
294
Italy
50mbps give huge file size...

can you please make a 25mbps MAX mod?:p
 
Last edited:

Trongable

Senior Member
Jun 22, 2010
72
7
Do you have any comparison clips of the stock settings?

EDIT: Woops, missed the replies right above.
 
Last edited:
Sep 5, 2010
34
0
Additional mod:
People have claimed on other devices changing this setting produces higher quality images from the camera, starting at line 216:
Code:
        <ImageEncoding quality="[COLOR="red"][b]100[/b][/COLOR]" />
        <ImageEncoding quality="80" />
        <ImageEncoding quality="70" />
        <ImageDecoding memCap="20000000" />

Can anyone post some pictures comparing the stock and this mod?
 

copkay

Senior Member
Jul 29, 2010
353
610
24fps is the stand rate. 30fps is just for marketing trick.

Not sure if serious. :/

24fps is just the film standard. 30fps is standard for a consumer videocamera, that and 60fps (which is far preferable, in my opinion). I seem to be one of the few people that feels this way, but I would prefer that films be shot at 60fps as well.
 
  • Like
Reactions: ufkal

Top Liked Posts

  • There are no posts matching your filters.
  • 17
    Any way this can be packaged up into a CWM flashable zip file to make it easier on those who are not familiar with using ADB?

    Second this. I tend to surf XDA for and apply mods like this while on the toilet at work.

    Sent from my Galaxy Nexus using Tapatalk
    8
    I was tinkering with media_profiles.xml yesterday and it appears that modifying the bitrate settings in here affects the camera. The stock bitrate min/max values are:

    min: 64000
    max: 12000000

    Videos shot with these settings are usually 6-10mbps bitrate. I have changed these values to:

    min: 35000000
    max: 60000000

    And my videos are now between 20mbps and 50mbps (huge leap!). The file sizes are bigger but I'm assuming this has to mean the videos will be somewhat better quality (my guess is mostly in low light when the ISO is cranked higher). I don't understand very well how these values are all used in here, but adjusting the bitrate ones does make a difference. Although framerate for 1080p says 30 here, they always come off camera at 24fps so I'm not sure if framerate (or any other changes) will work here.


    Any value higher than 60000000 for the max will cause the camera app to crash, so I think this is a good max for now. This mod has been done on countless other devices, so I'm in no way discovering anything new, I just decided to poke around and see what changes work :)


    Here's some more details for what to modify (to apply this mod to 720p and 1080p):

    Starting at line 127:
    Code:
            <EncoderProfile quality="720p" fileFormat="mp4" duration="30">
                <Video codec="h264"
                       [COLOR="Red"][b]bitRate="60000000"[/b][/COLOR]
                       width="1280"
                       height="720"
                       frameRate="30" />
                <Audio codec="aac"
                       bitRate="96000"
                       sampleRate="48000"
                       channels="1" />
            </EncoderProfile>
    
            <EncoderProfile quality="1080p" fileFormat="mp4" duration="30">
                <Video codec="h264"
                       [COLOR="red"][b]bitRate="60000000"[/b][/COLOR]
                       width="1920"
                       height="1080"
                       frameRate="30" />
                <Audio codec="aac"
                       bitRate="96000"
                       sampleRate="48000"
                       channels="1" />
            </EncoderProfile>

    And one other spot, line 340:
    Code:
        <VideoEncoderCap name="h264" enabled="true"
            minBitRate="[COLOR="red"][b]35000000[/b][/COLOR]" maxBitRate="[COLOR="red"][b]60000000[/b][/COLOR]"
            minFrameWidth="176" maxFrameWidth="1920"
            minFrameHeight="144" maxFrameHeight="1080"
            minFrameRate="15" maxFrameRate="30" />



    Additional mod:
    People have claimed on other devices changing this setting produces higher quality images from the camera, starting at line 216:
    Code:
            <ImageEncoding quality="[COLOR="red"][b]100[/b][/COLOR]" />
            <ImageEncoding quality="80" />
            <ImageEncoding quality="70" />
            <ImageDecoding memCap="20000000" />





    Steps to apply the mod:
    1) have ADB setup and working (not explaining that here, plenty of other threads for this)
    2) cd to some directory to work in (I just use the desktop), ensure ADB is in your path (google that part)
    3)
    Code:
    adb pull /etc/media_profiles.xml .
    to pull the media_profiles.xml file to whatever folder you're in with the terminal.
    4) Make your modifications, save the file (maybe keep a backup of the original file if you want).
    --- workaround because adb remount doesn't work] ---
    5)
    Code:
    adb push media_profiles.xml /sdcard/download
    6) Use root explorer to move the media_profiles.xml file from your downloads folder to the /etc folder (make sure to mount /etc as R/W before you try to move).
    7) Reboot phone, all set!

    EDIT
    - or just use Root Explorer (available in the market) to do the changes, reboot the phone and you're done!


    edit
    Demo video shot at 45mbps:
    http://www.youtube.com/watch?v=J2r6zPYlRD0

    http://www.youtube.com/watch?v=XCbNs1hEEjU


    Hope somebody else finds this as useful as me!
    6
    I fooled around with this some.. Firstly, testing out video before mod:
    Bit rate : 6 419 Kbps
    Width : 1 280 pixels
    Height : 720 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Variable
    Frame rate : 24.000 fps
    Minimum frame rate : 15.515 fps
    Maximum frame rate : 24.026 fps

    Then after modifying the media_properties.xml file with less aggressive values vs. the OP.
    Line 130: bitRate="10000000"
    Line 142: bitRate="25000000"
    Line 342: minBitRate="8000000" maxBitRate="25000000"

    Then a quick video test:

    After Mod:
    Bit rate : 9 731 Kbps
    Width : 1 280 pixels
    Height : 720 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Variable
    Frame rate : 30.000 fps
    Minimum frame rate : 22.294 fps
    Maximum frame rate : 30.120 fps

    So this seems to work.

    I've put a few modified files in .zip flashable format here. Please check readme.txt there for more info on each.




    I tested these on my own galaxy nexus cdma lte vzw with francisco #10 kernel and aokp build 14.. I cannot promise this will work for you and cannot take responsibility for any damage, flash at your own risk.
    5
    Second this. I tend to surf XDA for and apply mods like this while on the toilet at work.

    Sent from my Galaxy Nexus using Tapatalk

    This man knows what's up. Especially since I'm on the toilet right now :D

    Sent from my Galaxy Nexus using xda premium
    2
    can you please post info about bitrate of as full HD video? i never record in 720p :D
    Here it is...
    Modified 1080p results:
    Bit rate : 20.1 Mbps
    Width : 1 920 pixels
    Height : 1 080 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Variable
    Frame rate : 24.000 fps
    Minimum frame rate : 23.968 fps
    Maximum frame rate : 24.026 fps

    Stock 1080p results:
    Bit rate : 9 599 Kbps
    Width : 1 920 pixels
    Height : 1 080 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Variable
    Frame rate : 24.000 fps
    Minimum frame rate : 13.902 fps
    Maximum frame rate : 24.026 fps


    I think it's time to experiment more with the variables in the OP and extend to some other ones.. I'd imagine a more steady framerate would be desirable. My zip file was just a stab in the dark at settings, but it appears just based on numbers that it should already be an improvement over stock (at the cost of space)