[MOD]H.265 a.k.a 'hevc codec' Video Recording for OnePlus 2[Nougat/Oreo]

tusar8

Senior Member
Mar 30, 2017
263
81
0
Guwahati
Hello everyone,
As we all know that oneplus 2 supports hevc codec but by default it is not used as the primary video codec. So i've modified a system file to allow the camera to record with H.265 video codec by default.

*/
* * Your warranty is NOT void. * * I'm not responsible for bricked devices, dead SD cards, * thermonuclear war, or you getting fired because the alarm app failed. Please * do some research if you have any concerns about the modification * YOU are choosing to make these modifications, and if * you point the finger at me for messing up your device, I will laugh at you. * */


Steps:-
1)Take a nandroid backup.

2) Your device is rooted.

3)Download any file explorer that has access to system files. I prefer to use 'Root Browser'.

https://play.google.com/store/apps/details?id=com.jrummy.root.browserfree

4)Download the 'media_profiles.xml' , it will be linked below. (see post 2)

5)Open File Explorer and go to /system/etc and backup the original 'media_profiles.xml' in case you wanna revert back.

6)Now copy the modified media_profiles.xml file to /system/etc and replace it with the old one.

7)set permissions to rw-r-r (0644)

8)turn off the device> boot into recovery> clear cache only

9)restart and Enjoy :cool:

Special Thanks to @64ashg for spending his precious time creating the Magisk Module. [check post 2 for download]


This mod is working on some Nougat and Oreo ROMs.
Tested on Vertex ROM, RR, Pixel Experience,LineageOS 15.1
If it doesn't work on your ROM, report below. I'll see what i can do.


For OxygenOS - It isn't working. [Testing]

If you like the mod, you are welcome. And Don't be shy to hit the like button. Feel free to share the thread but do not mirror any download files. Just redirect everyone here.
 

Attachments

Last edited:

tusar8

Senior Member
Mar 30, 2017
263
81
0
Guwahati
I've made 3 files depending on user requirements.
1st[H.265 codec with Stock Bitrate](File Size won't be reduce, only the codec will change.)
4k - 42 Mbits
1080p - 20 Mbits
720p - 14 Mbits

2nd[H.265 codec with 50% reduced Bitrate] Consumes less storage space and use it only for day time shots. 1080p and 720p videos might pixilate while panning through scenes.
4k - 20 Mbits
1080p - 10 Mbits
720p - 7 Mbits

3rd[(Balanced) H.265 codec with 28% reduced Bitrate] Suitable for both day and night shots.
4k at 30 Mbits [Size-205 MB/min]
1080p & 720p at 15Mbits

Link for Magisk Module.

Balanced - https://mega.nz/#!egREXayA!MyXj7ZFs_xBgIZLH5uFz6HERdLWt38ZI3bG1VOMyQMw
 

Attachments

Last edited:

tusar8

Senior Member
Mar 30, 2017
263
81
0
Guwahati
I tested and its the same thing..looks like it didilnt changed the file.. (Stock bitrate) i get the same filesize,
Obviously it will create the same file size if you use the stock bitrate. Try the 50% reduced bitrate. Compare both 4k videos of h.264 and h.265.
 
Last edited:

tusar8

Senior Member
Mar 30, 2017
263
81
0
Guwahati
With stock bitrates why would I use h.265 over h.264?
If you are asking such a question, it clearly means that you don't know the difference between h.264 & h.265/hevc. H.265 exports video with the same quality as h.264 but reduces the file size by 40%(it doesn't automatically do its magic). You will need to adjust the bitrate for it to work. Now if anyone wants to record 4k video with H.265 and stock bitrate which is 42 Mbits, he/she can achieve the quality of the video normally where you will need to increase the bitrate upto 60/70 using h.264 codec.
 

Pierre2324

Senior Member
Oct 25, 2015
1,458
2,125
153
22
If you are asking such a question, it clearly means that you don't know the difference between h.264 & h.265/hevc. H.265 exports video with the same quality as h.264 but reduces the file size by 40%(it doesn't automatically do its magic). You will need to adjust the bitrate for it to work. Now if anyone wants to record 4k video with H.265 and stock bitrate which is 42 Mbits, he/she can achieve the quality of the video normally where you will need to increase the bitrate upto 60/70 using h.264 codec.
Thanks for your answer so the quality should be better if we use same bitatres?
 

tusar8

Senior Member
Mar 30, 2017
263
81
0
Guwahati
Thanks for your answer so the quality should be better if we use same bitatres?
Definitely. I've noticed 5% boost in quality. But it isn't that great as we all know that the quality of the video depends on many things like the sensor, framerate etc. So the big question, why should we use this mod?
Basically if we need to save our precious storage. ?
 

Pierre2324

Senior Member
Oct 25, 2015
1,458
2,125
153
22
Definitely. I've noticed 5% boost in quality. But it isn't that great as we all know that the quality of the video depends on many things like the sensor, framerate etc. So the big question, why should we use this mod?
Basically if we need to save our precious storage.
ok one last thing, the framerate is not that good on h.265? and if I flash an update do I loose the codec file I changed?
 

tusar8

Senior Member
Mar 30, 2017
263
81
0
Guwahati
ok one last thing, the framerate is not that good on h.265? and if I flash an update do I loose the codec file I changed?
Use oxygen camera at good lighting condition, it will constantly record at 30fps but at dark it drops to 20fps to brighten the video. So i use google camera at dark to have constant 30fps . And yes, you will loose the codec if you flash an update to your rom. And if you find 50% reduced bitrate video quality degraded, you can try the Balanced Bitrate file. It is good for both day and night time shots.
 
Last edited:

Tony Ralte

Member
Jun 26, 2017
26
7
0
No sound!

I followed the instructions and use media_profiles(Balanced). And I recorded videos, unfortunately there's no sound when i play the videos. Need help please.