[Sony Cross-Device General] Rizal Lovins:
Hacking Video Recording Bitrate

INFO for smali code

Value 1

Name: MediumRate

Data: 0xb71b00

Value 2

Name: MediumHighRate

Data: 0x10b0760

Value 3

Name: HighRate

Data: 0x1312d00

Value 4

Name: UltraHighRate

Data: 0x1c9c380​

1. Go to smali/com/sonyericsson/android/camera

open Constants.smali using text editor/notepad++ then find this line

For HD 720p

.field public static final VIDEO_BIT_RATE_EX_HIGH_12M:I = [COLOR="Red"]0xb71b00[/COLOR]

change to

.field public static final VIDEO_BIT_RATE_EX_HIGH_12M:I = [COLOR="Red"]0x10b0760[/COLOR]

For FULL HD 1080p

.field public static final VIDEO_BIT_RATE_EX_HIGH_17_5M:I = [COLOR="Red"]0x10b0760[/COLOR]

change to

.field public static final VIDEO_BIT_RATE_EX_HIGH_17_5M:I = [COLOR="Red"]0x1312d00[/COLOR]

save it!!!

2. Go to smali/com/sonyericsson/android/camera/configuration/parameters

open VideoSize.smali the find this line

For HD 720p

[COLOR="Red"]0xb71b00[/COLOR]

change to

[COLOR="Red"]0x10b0760[/COLOR]

For FULL HD 1080p

[COLOR="Red"]0x10b0760[/COLOR]

change that all code to

[COLOR="Red"]0x1312d00[/COLOR]

save it!!! Done ;)

NOW AFTER EDITING VIDEO AUDIO BITRATE & VIDEO BITRATE YOU NEED TO EDIT media_profile.xml

open media_profile.xml using text editor/notepad++ then find this line

FIX 100% Image Quality

<!ATTLIST ImageEncoding quality [COLOR="Red"](90|80|70|60|50|40)[/COLOR] #REQUIRED>

change to

<!ATTLIST ImageEncoding quality [COLOR="Red"](100|90|80|70|60|50)[/COLOR] #REQUIRED>

There is 2 lines code for back camera & front camera

<ImageEncoding quality="[COLOR="Red"]95[/COLOR]" />
<ImageEncoding quality="[COLOR="Red"]80[/COLOR]" />
<ImageEncoding quality="[COLOR="Red"]70[/COLOR]" />

change all code to

<ImageEncoding quality="[COLOR="Red"]100[/COLOR]" />
<ImageEncoding quality="[COLOR="Red"]90[/COLOR]" />
<ImageEncoding quality="[COLOR="Red"]80[/COLOR]" />

Adjust the value of smali Video & Audio Video bitrate with media-profile.xml (as you modified it)

There is many lines code for Video you need to change them all, example

<EncoderProfile quality="1080p" fileFormat="mp4" duration="60">
<Video codec="h264"
bitRate="17500000"
width="1920"
height="1080"
frameRate="30" />

<Audio codec="aac"
bitRate="156000"
sampleRate="48000"
channels="2" />
</EncoderProfile>

<EncoderProfile quality="720p" fileFormat="mp4" duration="60">
<Video codec="h264"
bitRate="12000000"
width="1280"
height="720"
frameRate="30" />

<Audio codec="aac"
bitRate="156000"
sampleRate="48000"
channels="2" />
</EncoderProfile>

change to

<EncoderProfile quality="1080p" fileFormat="mp4" duration="60">
<Video codec="h264"
bitRate="20000000"
width="1920"
height="1080"
frameRate="30" />

<Audio codec="aac"
bitRate="256000"
sampleRate="48000"
channels="2" />
</EncoderProfile>

<EncoderProfile quality="720p" fileFormat="mp4" duration="60">
<Video codec="h264"
bitRate="1750000"
width="1280"
height="720"
frameRate="30" />

<Audio codec="aac"
bitRate="256000"
sampleRate="48000"
channels="2" />
</EncoderProfile>

<VideoEncoderCap name="h264" enabled="true"
minBitRate="64000" maxBitRate="[COLOR="Red"]20000000[/COLOR]"
minFrameWidth="176" maxFrameWidth="1920"
minFrameHeight="144" maxFrameHeight="1080"
minFrameRate="15" maxFrameRate="30" />

<AudioEncoderCap name="aac" enabled="true"
minBitRate="8000" maxBitRate="[COLOR="Red"]256000[/COLOR]"
minSampleRate="8000" maxSampleRate="48000"
minChannels="1" maxChannels="[COLOR="Red"]2[/COLOR]" />

Note maxChannels Number in RED Color, can be 6 or 2