• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

[MOD][CAM] [email protected]@20mbps + auto-focus on CM7

Search This thread

LeJay

Senior Member
Apr 5, 2011
303
335
EDIT: [email protected] has been added to nightly and bitrate has been set to 12mbps which is not that bad. Its hence not recommended to flash these anymore. If you want higher bitrate look in the thread for those. I think it was pastime who made them. Alternatively use root explorer to manually edit /etc/mediaprofiles.XML. again, read pastimes and related posts in the thread on that.






This will replace the Camera.apk from CM7 with a more tegra2 friendly version that enables [email protected] recording. There's also included an updated media_profiles.xml file that'll enable different bitrates. Choose wisely :). To test the bitrate I recommend having it running for at a minute to make sure everything can keep up. Usually it starts out smooth and then starts stuttering as the ram gets filled up. I also upped the quality for still.

Videos (I'll add experimental stuff as well, such as ultra high bitrates and auto focus):
http://www.youtube.com/user/O2XdevVids

I would stay away with 64mb ram hacks for the time being. Maybe we can find some middle ground in the future :).

Anyway, please give me feedback on how it works. Some beautiful videos would be nice. Weather is really depressing here.

Please don't use this for non-tegra 2 devices.

Also, I'm experimenting a lot. Expect a lot to be buggy. I do my best not to put something out that doesn't work, but a couple of runs is really the extend of my testing before it goes up (to be honest). The autofocus-mod is seriously buggy. The bitrate-mod should be pretty much as buggy as the std. cm7 Camera app.
And, of course, thx to all the great ppl who works on cm.
------------------------------------------------------------
Source code (just the 1080p mod):
https://github.com/LeJay/Camera
 

Attachments

  • FullHDmod1.0-signed.zip
    498.3 KB · Views: 7,524
  • FullHDmod_low1.0-signed.zip
    498.3 KB · Views: 1,459
  • FullHDmod_high1.0-signed.zip
    498.3 KB · Views: 5,553
  • FullHDmod_mid1.0-signed.zip
    498.3 KB · Views: 7,330
  • FullHDmod_LG1.0-signed.zip
    498.3 KB · Views: 2,777
  • Autofocus1.1-signed.zip
    428.7 KB · Views: 6,405
Last edited:

LeJay

Senior Member
Apr 5, 2011
303
335
Versions & Changelog & TODO

--------------Autofocus1.1----------------- (Note this is horribly buggy)
Just adds auto focus (and 25/30fps if you're on nightly), no change to bitrate. Flash this AFTER you do the bitrate mods. Flashing with any of the bitrate mods will replace the Camera app and you'll lose autofocus.
----------------------------------------------

--------------FullHDmod 1.0---------------
->Video:
HD: [email protected]@20mbps
High: [email protected]@12mbps
----------------------------------------------
--------------FullHDmod_high 1.0---------- (works for some, requires fast sd card)
->Video:
HD: [email protected]@26mbps
High: [email protected]@12mbps
----------------------------------------------
--------------FullHDmod_mid 1.0---------- (Recommended)
->Video:
HD: [email protected]@17mbps
High: [email protected]@12mbps
----------------------------------------------
--------------FullHDmod_low 1.0----------
->Video:
HD: [email protected]@14mbps
High: [email protected]@12mbps
----------------------------------------------
--------------FullHDmod_LG 1.0---------- (It's the settings used as stock LG... except for 1080p being 30fps)
->Video:
HD: [email protected]@9mbps
High: [email protected]@4mbps
----------------------------------------------
----------BitrateMod(720p only)---------- (Does not replace Camera.apk. Works for 64mb ram hack, until we find other solution)
->Video:
HD: [email protected]@20mbps
High: [email protected]@10mbps
----------------------------------------------
All audio is 128 kbps and all stills are:
Super fine: 100
Fine: 90
Normal: 80

--------------------------------CHANGELOG----------------------------------------
1.0 Initial release.
---- Small bugfix of CM7s camera app + tegra 2 specific stuff.

1.1-pre-alpha
---- Enables autofocus prior to video capture. Cannot be turned off(I don't do UIs,lol). Need to restart app for each video.

Autofocus 1.1
---- No need to restart app.
Known issues:
Does no longer auto adjust for exposure while recording. In between recordings it will auto adjust again. (I have no idea why).
Cannot disable autofocus (have no idea how to do UI).
Rather buggy, lots of freezes. For best results, don't push it. Ie. don't start and stop recordings rapidly, stuff like that.
Don't switch quickly to video when opening app... I think that might be a cm7 issue.
---------------------------------------TODO----------------------------------------
Touch to focus.
continuous auto-focus.
 
Last edited:

LeJay

Senior Member
Apr 5, 2011
303
335
FAQ

Q: Does this work for non-CM7 ROMS?
A: Probably not. Certainly not froyo. But feel free to try and let me know. On stock rom-based builds, please look at somemadcaaant's awesome work at http://forum.xda-developers.com/showthread.php?t=1090785.

Q: T-Mobile LG G2x support?
A: Yes.

Q: What are the disadvantages?
A: Larger filesize. Takes longer to save (give it time to save before doing anything else with the phone). Potential issues with playback on phone.

Q: Does this work with 64 mb ram hack?
A: No. You can still use a high bitrate 720p mod for that kernel, though.

Q: It stutters after a few secs of recording or freezes once in a while, why is this?
A: Your phone/sdcard is having issues trying to keep up. Try a lower bitrate mod. If there is no lower, ask for one. I'm experimenting a little myself, trying to find a stable bitrate.

Q: If I open the Camera app and very quickly change to video I get a black screen?
A: Don't do that. I get the same bug on std. cm7 Camera app.

Q: Isn't it overkill with an FAQ for a camera mod?
A: Yes. But people kept asking the same questions last time I made a thread.
 
Last edited:

LeJay

Senior Member
Apr 5, 2011
303
335
Tegra 2 is some impressive hardware.... bitrate goes up crazy high. I'll add some different versions, but do people have any thoughts on what kind of bit rates they'd like to see?

Damn, I think maybe my sdcard cant keep up with the ultra high bit rates I'm testing. Starts stuttering after 10 sec. Maybe someone out there with a class 10 card?
 
Last edited:

ranrick

Senior Member
Jul 29, 2010
228
14
I purposely made my tweaks so code is first running when you actually start recording... If it's a new problem it's because of the settings file.
Tried restarting the app?

I reinstalled. Thereafter i was able to start it. But Recording doesn't work so far.It starts at 720P but when ending the recodring, I get a FC. 1080p keeps black screen and no FC and no recording. Maybe because of the 64MB RAM hack in the vorkKernal.
 

TattooHtc

Senior Member
Jun 22, 2010
79
10
Thanks LeJay :D

But i have a bug.... The video is lagging(I think my Sd Card is Class 2), so i think it is because of the high bitrate. And sometimes after shooting a video the camera just freezes and i have to pull the battery..

LG O2x, Latest Kang, stock kernel.
 
  • Like
Reactions: LeJay

LeJay

Senior Member
Apr 5, 2011
303
335
I reinstalled. Thereafter i was able to start it. But Recording doesn't work so far.It starts at 720P but when ending the recodring, I get a FC. 1080p keeps black screen and no FC and no recording. Maybe because of the 64MB RAM hack in the vorkKernal.

Okay, so it officially doesn't work with the 64 mb ram hack. Not surprising. You can enable high bitrate 720p with some of my other mods.
 

ermacwins

Senior Member
Aug 25, 2009
5,865
996
Thanks LeJay :D

But i have a bug.... The video is lagging(I think my Sd Card is Class 2), so i think it is because of the high bitrate. And sometimes after shooting a video the camera just freezes and i have to pull the battery..

LG O2x, Latest Kang, stock kernel.

Isnt that the case with cm7 nightlies and 1080p recording?

Can someone up a vid?
 

LeJay

Senior Member
Apr 5, 2011
303
335
Thanks LeJay :D

But i have a bug.... The video is lagging(I think my Sd Card is Class 2), so i think it is because of the high bitrate. And sometimes after shooting a video the camera just freezes and i have to pull the battery..

LG O2x, Latest Kang, stock kernel.


Hmm... I just recorded for 1 min straight with no issue. I do get similar issues on som2e of the higher bitrates I've been toying with(40mbps can make most sd cards cry). Does it start lagging as soon as you start recording?

I'm going to make higher and lower bitrate versions.
 

sibbor

Senior Member
Jul 28, 2008
663
330
sibbor.nu
@LeJay: you should contact arcee to include your mod in CM tree
Agreed.

LeJay, I also think that you should contact Ricardo (arcee) and see if he can merge you changes. He just changed from 1080 to 1088 the other day in the .xml file so we can record 1080p nativly. Kinda wierd that you have to set it to 1088?

The best thing would of course be if he could include all the different modes/profiles for us to freely choose:
"FPS: 15, 25, 30"
"Resolution: 1080p, 720p, ..."
"Bitrate: X, Y, Z"
"Sound: 44 Khz, ..."

etc... because I know my class 2 card can't keep up at the best options. Going to buy me a new one soon though.

Send him a message and see if he's interested. His todo list probably is long though....
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 34
    EDIT: [email protected] has been added to nightly and bitrate has been set to 12mbps which is not that bad. Its hence not recommended to flash these anymore. If you want higher bitrate look in the thread for those. I think it was pastime who made them. Alternatively use root explorer to manually edit /etc/mediaprofiles.XML. again, read pastimes and related posts in the thread on that.






    This will replace the Camera.apk from CM7 with a more tegra2 friendly version that enables [email protected] recording. There's also included an updated media_profiles.xml file that'll enable different bitrates. Choose wisely :). To test the bitrate I recommend having it running for at a minute to make sure everything can keep up. Usually it starts out smooth and then starts stuttering as the ram gets filled up. I also upped the quality for still.

    Videos (I'll add experimental stuff as well, such as ultra high bitrates and auto focus):
    http://www.youtube.com/user/O2XdevVids

    I would stay away with 64mb ram hacks for the time being. Maybe we can find some middle ground in the future :).

    Anyway, please give me feedback on how it works. Some beautiful videos would be nice. Weather is really depressing here.

    Please don't use this for non-tegra 2 devices.

    Also, I'm experimenting a lot. Expect a lot to be buggy. I do my best not to put something out that doesn't work, but a couple of runs is really the extend of my testing before it goes up (to be honest). The autofocus-mod is seriously buggy. The bitrate-mod should be pretty much as buggy as the std. cm7 Camera app.
    And, of course, thx to all the great ppl who works on cm.
    ------------------------------------------------------------
    Source code (just the 1080p mod):
    https://github.com/LeJay/Camera
    12
    Versions & Changelog & TODO

    --------------Autofocus1.1----------------- (Note this is horribly buggy)
    Just adds auto focus (and 25/30fps if you're on nightly), no change to bitrate. Flash this AFTER you do the bitrate mods. Flashing with any of the bitrate mods will replace the Camera app and you'll lose autofocus.
    ----------------------------------------------

    --------------FullHDmod 1.0---------------
    ->Video:
    HD: [email protected]@20mbps
    High: [email protected]@12mbps
    ----------------------------------------------
    --------------FullHDmod_high 1.0---------- (works for some, requires fast sd card)
    ->Video:
    HD: [email protected]@26mbps
    High: [email protected]@12mbps
    ----------------------------------------------
    --------------FullHDmod_mid 1.0---------- (Recommended)
    ->Video:
    HD: [email protected]@17mbps
    High: [email protected]@12mbps
    ----------------------------------------------
    --------------FullHDmod_low 1.0----------
    ->Video:
    HD: [email protected]@14mbps
    High: [email protected]@12mbps
    ----------------------------------------------
    --------------FullHDmod_LG 1.0---------- (It's the settings used as stock LG... except for 1080p being 30fps)
    ->Video:
    HD: [email protected]@9mbps
    High: [email protected]@4mbps
    ----------------------------------------------
    ----------BitrateMod(720p only)---------- (Does not replace Camera.apk. Works for 64mb ram hack, until we find other solution)
    ->Video:
    HD: [email protected]@20mbps
    High: [email protected]@10mbps
    ----------------------------------------------
    All audio is 128 kbps and all stills are:
    Super fine: 100
    Fine: 90
    Normal: 80

    --------------------------------CHANGELOG----------------------------------------
    1.0 Initial release.
    ---- Small bugfix of CM7s camera app + tegra 2 specific stuff.

    1.1-pre-alpha
    ---- Enables autofocus prior to video capture. Cannot be turned off(I don't do UIs,lol). Need to restart app for each video.

    Autofocus 1.1
    ---- No need to restart app.
    Known issues:
    Does no longer auto adjust for exposure while recording. In between recordings it will auto adjust again. (I have no idea why).
    Cannot disable autofocus (have no idea how to do UI).
    Rather buggy, lots of freezes. For best results, don't push it. Ie. don't start and stop recordings rapidly, stuff like that.
    Don't switch quickly to video when opening app... I think that might be a cm7 issue.
    ---------------------------------------TODO----------------------------------------
    Touch to focus.
    continuous auto-focus.
    6
    FAQ

    Q: Does this work for non-CM7 ROMS?
    A: Probably not. Certainly not froyo. But feel free to try and let me know. On stock rom-based builds, please look at somemadcaaant's awesome work at http://forum.xda-developers.com/showthread.php?t=1090785.

    Q: T-Mobile LG G2x support?
    A: Yes.

    Q: What are the disadvantages?
    A: Larger filesize. Takes longer to save (give it time to save before doing anything else with the phone). Potential issues with playback on phone.

    Q: Does this work with 64 mb ram hack?
    A: No. You can still use a high bitrate 720p mod for that kernel, though.

    Q: It stutters after a few secs of recording or freezes once in a while, why is this?
    A: Your phone/sdcard is having issues trying to keep up. Try a lower bitrate mod. If there is no lower, ask for one. I'm experimenting a little myself, trying to find a stable bitrate.

    Q: If I open the Camera app and very quickly change to video I get a black screen?
    A: Don't do that. I get the same bug on std. cm7 Camera app.

    Q: Isn't it overkill with an FAQ for a camera mod?
    A: Yes. But people kept asking the same questions last time I made a thread.
    2
    Well tested the camera mod on g2x cm7 rc1 with the o2x lib file and am getting 29-30 fps!! will report back in a few when i test the g2x lib file

    Confirmed!! the g2x lib file cuts the fps in half!!! so use the o2x one!!!!! i have attached the O2x file! this was tested om cm7 rc1!

    WARNING NOT A FLASHABLE ZIP FILE!!!!
    See post 165 or right below for Flashable version!
    2
    Can you update/resume this amazing work lejay?? :)

    The CM took the [email protected] change into their release. If you want to increase the bitrate, you just have to change /etc/mediaprofiles.XML. (You might have to reboot the phone for the change to take effect). It will literally let you take it to 60mbps and beyond, but the hardware can't handle it(it stutters).
    It does slightly make me drool to think about what is possible on Tegra 3, or even 4.

    Anyway, I finished my (completely unrelated to this) phd and have gone backpacking in southeast asia. I feel like my next phone is an android, so it's not impossible I'll join CM in improving their camera app (which was severely lacking the last time I looked), when I figure out what to do with my life.


    EDIT: This is about Android in general:

    Oh, yeah, one thing I'd love to do, which none of the skins seems to be doing(and stock neither). You know the function where it takes multiple pictures in rapid succession? I'd love to have the software automatically figure out which of the pictures have the least blur (these things can be calculated). This might seem like a tiny thing, but people are lazy as hell, when it comes to photography and could make a significant change for day to day usage. The truth is that I probably just like the mathematical challange of comparing blur among different pictures (this is an active research area). All in all, there's a lot of fascinating math to be done in this area... Just look at 808 pureview.