[MOD] Increase Camera Audio/Video/Image Quality [Updated - 18th Dec 2012]

Search This thread

mohit1234

Senior Member
Oct 31, 2010
1,089
1,089
Seattle
Hey everyone!

First and Foremost, DO A NANDROID BACKUP!!!!! I am not responsible for any mistakes that you make or if anything happens to your phone.

Seeing that some users are complaining about the noise present in the video recordings, I've been able to increase the video bitrate to 20mbps.

Here's how to do it.

  • Using a file browser (like root explorer/es file explorer etc) go to the /system/etc folder
  • Make sure your system is mounted RW
  • Search for the media_profiles.xml file and open it up in any text editor
  • Once you scroll down you will see the following:

    Code:
    <EncoderProfile quality="1080p" fileFormat="mp4" duration="30">
                <Video codec="h264"
                       bitRate="12000000"
                       width="1920"
                       height="1080"
                       frameRate="30" />
                <Audio codec="aac"
                       bitRate="96000"
                       sampleRate="48000"
                       channels="1" />
            </EncoderProfile>
  • Change the bitRate from 12000000 to 20000000
  • Save, make sure permissions are rw-r--r-- and then reboot.

I have tested this and it works perfectly.

35d9kzo.png
2dbjcw1.png



I have not messed around with anymore settings yet, will be doing so next weekend. I'm kinda busy with finals week so if you all want, you can try changing other settings and report back your findings!
Note that all the details under <CamcorderProfiles cameraId="0"> are for the rear camera and the ones under <CamcorderProfiles cameraId="1"> are for the front facing camera.

Hope this can inspire more findings and more ways to make the image and video quality better! :good:

Update
Here are some flashable zips. I have tested them and they are working fine.

Stock
Increase 1080p video bitrate to 20mbps

I will be testing tocirahl's findings and adding flashable zips for those MODs soon.

Update 2 (18th Dec 2012)
Here is another flashable zip with the following additions:-

Both 1080p and 720p audio bitrate has been boosted to 288k (this is the max for now)
Both 1080p and 720p audio channels have been changed from 1(mono) to 2(stereo). [NOTE: I can't confirm whether this is useful as on testing, it seems like a very small increase in quality but that could be a placebo. However, I have still added it]
1080p video bitrate has been boosted to 20mbps (this is the max that is can go for now)
720p video bitrate has been boosted to 12mbps (this is the max that is can go for now)
All the above has been changed for both the regular 720p and 1080p videos and the time lapse 720p and 1080p videos.
Image Decoding Memory Cap has been doubled from 20mb to 40mb. (Image quality seems to have become slightly better)

Download Here

NOTE: All these MODs will increase the file size of the videos and images.

Thanks a lot to the following users for their findings:-
0.0
cguru
a5ehren
IAmAN00bie
terr


If this is in the wrong section, please could one of the MODs move it? Thanks and sorry for the inconvenience!
 
Last edited:

sparky_boi

Senior Member
Feb 21, 2011
127
23
<EncoderProfile quality="1080p" fileFormat="mp4" duration="30">
<Video codec="h264"
bitRate="12000000"
width="1920"
height="1080"
frameRate="30" />
<Audio codec="aac"
bitRate="96000"
sampleRate="48000"
channels="1" />
</EncoderProfile>

What about changing bitRate under audio to something like 320000? Would that make it 320kbs and improve audio?
How about changing channels from 1 to 2 (I assume 2 channels means stereo?)

Also, you picked 20Mbps bitrate for video... can we go higher than this, or is this the limit?

Thanks.
 

mohit1234

Senior Member
Oct 31, 2010
1,089
1,089
Seattle
What about changing bitRate under audio to something like 320000? Would that make it 320kbs and improve audio?
How about changing channels from 1 to 2 (I assume 2 channels means stereo?)

Also, you picked 20Mbps bitrate for video... can we go higher than this, or is this the limit?

Thanks.

I haven't tried any of those yet. I have my finals this week, so I'll be testing all possible options on the weekend and updating the OP accordingly.
However, technically they should work, but can't say for sure.
For the video bitrate, I remember the Sensation could go upto 40mbps, so I guess we could try increasing it and seeing how far it could go..

Just thought I'll put this out so that others can play around with the numbers and find ways to make the camera better.
 
Last edited:

tocirahl

Senior Member
Jun 18, 2012
174
23
If you look at the bottom of the file, it looks like the maximum audio rate you can get is 288000

Changing Channels to 2 seems to do nothing, but I can confirm that the audio goes up to 284k (288000)

Best I can tell, any number above 20000000 breaks Gallery.

Also, this might be placebo effect, but I definitely feel like I'm getting better quality images by changing the three <ImageEncoding quality="" /> lines to 100, 95, 80 and changing memCap to 40000000 (doubling it)

EDIT: There seems to be a very small increase in quality from changing the ImageEncoding lines, especially in HDR mode. I'll see if I can get some outdoor shots later.
 
Last edited:
  • Like
Reactions: mohit1234

mmeidl78

Senior Member
May 6, 2010
490
198
Ulm
If you look at the bottom of the file, it looks like the maximum audio rate you can get is 288000

Changing Channels to 2 seems to do nothing, but I can confirm that the audio goes up to 284k (288000)

Best I can tell, any number above 20000000 breaks Gallery.

Also, this might be placebo effect, but I definitely feel like I'm getting better quality images by changing the three <ImageEncoding quality="" /> lines to 100, 95, 80 and changing memCap to 40000000 (doubling it)

EDIT: There seems to be a very small increase in quality from changing the ImageEncoding lines, especially in HDR mode. I'll see if I can get some outdoor shots later.

Could you make a flashable ZIP with the working maximum? I've changed the values and after a reboot I've got a bootloop. Maybe it works with a flashable ZIP?
 

Qbancelli

Senior Member
Feb 1, 2012
343
92
NYC
Something went wrong!

I tried this. Follow the instructions carefully, but when I did a restart the phone got stuck on the Android logo.:(
 

eRajesh

Senior Member
Jul 15, 2010
647
203
Kolkata
Haha! I actually did the same thing on my Nexus 4 today. This media_profiles.xml mod is very common. The GNexus also had it.

The first thing I did after rooting my N4 was to edit the media_profiles.xml file
 

Audioboxer

Senior Member
Aug 24, 2010
3,035
670
Editing myself resulted in a lot of weird issues, no bootloop, but I lost the ability to choose camera resolution settings (720p/1080p), and it FC on change to front camera.

Will await someone with more skill to release some user friendly mods for the camera.
 

mohit1234

Senior Member
Oct 31, 2010
1,089
1,089
Seattle
This does indeed work, many thanks!

No problem!

If you look at the bottom of the file, it looks like the maximum audio rate you can get is 288000

Changing Channels to 2 seems to do nothing, but I can confirm that the audio goes up to 284k (288000)

Best I can tell, any number above 20000000 breaks Gallery.

Also, this might be placebo effect, but I definitely feel like I'm getting better quality images by changing the three <ImageEncoding quality="" /> lines to 100, 95, 80 and changing memCap to 40000000 (doubling it)

EDIT: There seems to be a very small increase in quality from changing the ImageEncoding lines, especially in HDR mode. I'll see if I can get some outdoor shots later.

Awesome! I'll try these out before making a flashable zip for them.
Thanks for the info! :good:

Could you make a flashable ZIP with the working maximum? I've changed the values and after a reboot I've got a bootloop. Maybe it works with a flashable ZIP?
I tried this. Follow the instructions carefully, but when I did a restart the phone got stuck on the Android logo.:(

Added a flashable zip in the OP.
Not sure why you are getting a bootloop. Did you set the permissions to rw-r--r--?

Haha! I actually did the same thing on my Nexus 4 today. This media_profiles.xml mod is very common. The GNexus also had it.

The first thing I did after rooting my N4 was to edit the media_profiles.xml file

Haha yeah its quite common. I had it in the Desire HD and Sensation threads as well! :D

Editing myself resulted in a lot of weird issues, no bootloop, but I lost the ability to choose camera resolution settings (720p/1080p), and it FC on change to front camera.

Will await someone with more skill to release some user friendly mods for the camera.

I'm not having any weird issues. I never released any MOD without making sure that its working as intended.
I've added a flashable zip in the OP. Try that.
Added one for going back to the stock settings as well, just in case users are having issues.
Will be adding more MODs as and when I get time to test them fully.
 

hatyrei

Senior Member
Jul 29, 2011
488
35
houston
No problem!



Awesome! I'll try these out before making a flashable zip for them.
Thanks for the info! :good:




Added a flashable zip in the OP.
Not sure why you are getting a bootloop. Did you set the permissions to rw-r--r--?



Haha yeah its quite common. I had it in the Desire HD and Sensation threads as well! :D



I'm not having any weird issues. I never released any MOD without making sure that its working as intended.
I've added a flashable zip in the OP. Try that.
Added one for going back to the stock settings as well, just in case users are having issues.
Will be adding more MODs as and when I get time to test them fully.


Hi Mr. Developer :),

Do I need to edit xml iles after i flashed that one? thanks.
 

DforDesign

Senior Member
Jul 1, 2011
435
73

Top Liked Posts

  • There are no posts matching your filters.
  • 165
    Hey everyone!

    First and Foremost, DO A NANDROID BACKUP!!!!! I am not responsible for any mistakes that you make or if anything happens to your phone.

    Seeing that some users are complaining about the noise present in the video recordings, I've been able to increase the video bitrate to 20mbps.

    Here's how to do it.

    • Using a file browser (like root explorer/es file explorer etc) go to the /system/etc folder
    • Make sure your system is mounted RW
    • Search for the media_profiles.xml file and open it up in any text editor
    • Once you scroll down you will see the following:

      Code:
      <EncoderProfile quality="1080p" fileFormat="mp4" duration="30">
                  <Video codec="h264"
                         bitRate="12000000"
                         width="1920"
                         height="1080"
                         frameRate="30" />
                  <Audio codec="aac"
                         bitRate="96000"
                         sampleRate="48000"
                         channels="1" />
              </EncoderProfile>
    • Change the bitRate from 12000000 to 20000000
    • Save, make sure permissions are rw-r--r-- and then reboot.

    I have tested this and it works perfectly.

    35d9kzo.png
    2dbjcw1.png



    I have not messed around with anymore settings yet, will be doing so next weekend. I'm kinda busy with finals week so if you all want, you can try changing other settings and report back your findings!
    Note that all the details under <CamcorderProfiles cameraId="0"> are for the rear camera and the ones under <CamcorderProfiles cameraId="1"> are for the front facing camera.

    Hope this can inspire more findings and more ways to make the image and video quality better! :good:

    Update
    Here are some flashable zips. I have tested them and they are working fine.

    Stock
    Increase 1080p video bitrate to 20mbps

    I will be testing tocirahl's findings and adding flashable zips for those MODs soon.

    Update 2 (18th Dec 2012)
    Here is another flashable zip with the following additions:-

    Both 1080p and 720p audio bitrate has been boosted to 288k (this is the max for now)
    Both 1080p and 720p audio channels have been changed from 1(mono) to 2(stereo). [NOTE: I can't confirm whether this is useful as on testing, it seems like a very small increase in quality but that could be a placebo. However, I have still added it]
    1080p video bitrate has been boosted to 20mbps (this is the max that is can go for now)
    720p video bitrate has been boosted to 12mbps (this is the max that is can go for now)
    All the above has been changed for both the regular 720p and 1080p videos and the time lapse 720p and 1080p videos.
    Image Decoding Memory Cap has been doubled from 20mb to 40mb. (Image quality seems to have become slightly better)

    Download Here

    NOTE: All these MODs will increase the file size of the videos and images.

    Thanks a lot to the following users for their findings:-
    0.0
    cguru
    a5ehren
    IAmAN00bie
    terr


    If this is in the wrong section, please could one of the MODs move it? Thanks and sorry for the inconvenience!
    8
    Camera Samples before and after MOD.v2 !!!!

    Is it possible to get some decent before and after shots up please?

    Plus can I stress that -

    1. They are static shots of something moving and vaguely interesting (cars going by on a road etc.) rather than wavey shakey cam which is useless.

    2. The before and after shots are of the same scene/location and around the same time for comparison.

    If you have to pan the phone around then do it s l o w l y. Folks always make the mistake of moving the cam around too fast. It aint a RED camera.:laugh:

    Thanks

    :good:Hi mohit1234 and everyone, first, thanks for the work done here in this MOD.
    I´m running stock ROM 4.2.1, rooted. And as a lot of you asked for the comparison shots and videos that's what I did, every picture and video taken was made on a tripod (the steadiest way that I could), I put as much items that I can in front of the camera, and with various colors so somebody can analyze the quality (I'm not an expert on it), for the video I also put a clock on the scene as dagles want it. That's all for now and I hope this will help.:good:

    Pictures:
    First, I took 2 pictures full auto without flash, and the other 2 full auto with flash (both without the MOD).
    Second, same thing as above but with the MOD.v2.

    Videos: (will be in youtube, the links at bottom)
    First, 2 videos in 720p and 2 more in 1080p with and without flash (both without the MOD).
    Second, same as above but after flashing MOD.v2.

    Original 720p w/o flash
    http://youtu.be/wkB5E4PW-94

    Original 720p w flash
    http://youtu.be/pdF9Ve5OGTY

    Original 1080p w/o flash
    http://youtu.be/OL0yKahfKxM

    Original 1080p w flash
    http://youtu.be/zfdQc5sYdgQ

    MOD.v2 720p w/o flash
    http://youtu.be/t0zyYAqxB-Q

    MOD.v2 720p w flash
    http://youtu.be/zCjJ4QaMPbo

    MOD.v2 1080p w/o flash
    http://youtu.be/7eF_iEkAB14

    MOD.v2 1080p w flash
    http://youtu.be/ABQJk0lWS44

    Ok, If someone needs the original video files, just let me know and I'll upload them to some server. Best regards to everybody and I'm glad to help on this !!!!!:good:

    PS: I found another thread that talks about something similar (is for the Sprint LG Optimus G), some people talk about using PIMP my ROM, or Sensor Camera app, if you guys can also take a look at it, maybe there's something helpful for our nexus4 (it's almost the same hardware), here's the link to the thread: http://forum.xda-developers.com/showthread.php?t=2065799, (sorry for the english, is not my native language).

    Bye bye from CHILE, Southamerica with love and dedication to XDA Nexus 4 Yeahhhhhh !!!!!!
    6
    Any updates on changing baseline to highline ? :confused:

    I'm working on it. I've got the files and I've made the necessary edits. Now I'm working on compiling the source and then forcing it to run highline.
    Having a few issues with compiling though.. :confused:
    5
    Only the bitrate. I think you can also change the value for 480p (not tested by me!), though there will be now gain in image quality if you ask me.
    On this small resolution this bitrate should be way to high.

    Just take a look at the xml in the zip I succesfully flashed.

    720p @ 12mbit
    1080p @ 20mbit

    Audio both @ 192kbit/s

    Changed values for photos
    <ImageEncoding quality="100"/>
    <ImageEncoding quality="100"/>
    <ImageEncoding quality="100"/>
    <ImageDecoding memCap="40000000"/>

    No problems so far.
    5
    At least give me the credits for finding this out....

    http://forum.xda-developers.com/showthread.php?t=2038651

    nice work btw :good:

    If I see someone telling "give me credit for..." he can be sure I wont do this.

    Media profile xml editing is well known and I did this in several phones. Nothing spectacular...

    Sent from my Nexus 4 using Tapatalk 2
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone