yashsingh1/xdaforums huggingface dataset:
[Nexus 7 Original Development] fattire:
Hmmm....

in packages/apps/Camera/src/com/android/camera/DisableCameraReceiver.java:

-----

// We want to disable camera-related activities if there is no camera. This

// receiver runs when BOOT_COMPLETED intent is received. After running once

// this receiver will be disabled, so it will not run again.

public class DisableCameraReceiver extends BroadcastReceiver {

private static final String TAG = "DisableCameraReceiver";

private static final boolean CHECK_BACK_CAMERA_ONLY = false;

private static final String ACTIVITIES[] = {

"com.android.camera.CameraLauncher",

};

@Override

public void onReceive(Context context, Intent intent) {

// Disable camera-related activities if there is no camera.

boolean needCameraActivity = CHECK_BACK_CAMERA_ONLY

? hasBackCamera()

: hasCamera();

if (!needCameraActivity) {

Log.i(TAG, "No sensors detected and so, disable all camera activities/CameraLauncher");

for (int i = 0; i < ACTIVITIES.length; i++) {

disableComponent(context, ACTIVITIES);

}

}

I think that's the problem. N7 has a front camera but no back camera.
[Nexus 7 Original Development] hillbeast:
I think add a define in the BoardConfig.mk, something like FORCE_CAMERA_SHORTCUT=y, and do

#ifndef FORCE_CAMERA_SHORTCUT
if (!needCameraActivity) {
Log.i(TAG, "No sensors detected and so, disable all camera activities/CameraLauncher");
for (int i = 0; i < ACTIVITIES.length; i++) {
disableComponent(context, ACTIVITIES[i]);
}
}
#endif

Or however that code would work in Java. I don't know anything about Java so I'm just going by how I'd do it in C.
[Nexus 7 Original Development] thoughtlesskyle:
is there anyway you could upload the camera APK from your rom, i want to make a flashable zip for this

Edit: Actually I am using cm10 so I shouldn't need the apk then should I?
[Nexus 7 Original Development] hillbeast:
There is no more Camera apk in JB. The file that needs to be changed is specified in the OP. Please read the OP.
[Nexus 7 Original Development] JeepFreak:
Hells yeah! Looks like this was cherry picked in FitSnugly's 0905 build! :D

Thanks again OP!

Billy
[Nexus 7 Original Development] oldlight:
It works, definitely. You just open file in ES Explorer, edit the content as instructed, and then reboot.

^^
[Nexus 7 Original Development] maverik410:
Hi all

i have tried this and got it working then i messed up i deleted the media_profiles.xml by mistake

could some one upload the file for me so i can put it back :crying:

thanks in advance
[Nexus 7 Original Development] swordrune10:
I assumed there still wasn't one since the commits r still taking forever to merge
[Nexus 7 Original Development] donpippo:
Here the file

https://www.box.com/shared/1mpdutnng0n7me7b1avi

By the way, once you edited the file do you need to reboot?

Because I don't see difference in the camera app.

Thanks
[Nexus 7 Original Development] nehasingh:
I'm pretty impressed, I'm currently using Xperia Mini Pro and it also offers great video recording but I'm really amazed with Nexus 7 HD videos.
[Nexus 7 Original Development] blownart:
Works perfectly, and yes people you need to reboot.

However I noticed a bug with this mod today, if you leav quality on 720p and turn time lapse on, the camera app will crash, and you will not be able to select video recording again even if you uninstall the camera app. However I managed t fix it by further editing the media_profiles.xml files.

So here is the fix:

<EncoderProfile quality="timelapse480p" fileFormat="3gp" duration="30">
<Video codec="h264"
bitRate="4000000"
width="640"
height="480"
frameRate="30" />
<!--
The Audio part of the profile will not be used since time lapse mode
does not capture audio
-->
<Audio codec="aac"
bitRate="96000"
sampleRate="44100"
channels="1" />
</EncoderProfile>

+ <EncoderProfile quality="timelapse720p" fileFormat="3gp" duration="30">
+ <Video codec="h264"
+ bitRate="16000000"
+ width="1280"
+ height="720"
+ frameRate="30" />
+ <!-- The Audio part of the profile will not be used since time lapse mode
+ does not capture audio
+ -->
+ <Audio codec="aac"
+ bitRate="96000"
+ sampleRate="44100"
+ channels="1" />
+ </EncoderProfile>
[Nexus 7 Original Development] cyr0s:
Thanks for this, it looks really nice. I'll be updating n7ui tomorrow to automate this patch.
[Nexus 7 Original Development] hillbeast:
Yes I'm aware of this. This fix was submitted when I committed to CM. Still waiting for it to be merged.
[Nexus 7 Original Development] zaclimon:
Hi I want to know if this is applicable to any device with a decent camera (I want to use 720p recording to the samsung YP-G1)

Thanks.
[Nexus 7 Original Development] parker09:
Looks very good.

Why wouldn't they provide this patch as stock? Seems like a good feature.
[Nexus 7 Original Development] ogdobber:
ha, they didn't even include a camera launcher, why would they need 720

thanks op
[Nexus 7 Original Development] simms22:
hey, i know an ogdobber. havent seen him in a bit, what did you do with him :eek:
[Nexus 7 Original Development] ogdobber:
hey simms, i'm back. got busy:highfive:
[Nexus 7 Original Development] simms22:
woot!

im glad my buddy is back :)

(happened to run out of thanks just right now :( )
[Nexus 7 Original Development] fattire:
Jeesh... front page...

http://www.xda-developers.com/android/720p-video-recording-on-the-google-nexus-7/
[Nexus 7 Original Development] bennor3814:
One small warning. Had my Nexus 7 soft brick after trying to add the "timelapse720p" code to the file that already had the 720p code from the OP post. Nexus 7 is on stock firmware, unlocked and rooted. Used ES File Explorer to open the file in the ES Editor program, pasted in the code, saved the file, set the file permissions (644) with ES File Explorer, rebooted and the Nexus 7 hanged on the multi colored X screen during boot. After some experimentation that yielded no solutions to bypass the X screen, re-flashed the stock firmware and the tablet finally was able to boot properly. Have yet to go back in and add these code changes to see if it works or bricks again.
[Nexus 7 Original Development] hillbeast:
As long as the SoC supports it (the video encoder supports the resolution and bitrate), yes.

No clue. I think they didn't want people using the device as a camera.

Might have damaged another file somehow. The worst that this mod can do is break video encoding.
[Nexus 7 Original Development] jakis39:
Lesson learned: 720p resolution != high-quality video.
[Nexus 7 Original Development] rushter:
Thanks - I also noticed that you cannot take a screenshot while in the camera program - gives you a sd card storage in use error. So I took this with my SGS2 - Lol.

Thanks again... fun mod.

720p video picture
[Nexus 7 Original Development] akbisw:
Well it is definitely better than the 480p on the n7.
[Nexus 7 Original Development] marty331:
Awesome mod, simple and works perfect!
[Nexus 7 Original Development] espionage724:
Technically, wouldn't this be any Tegra 3 device?
[Nexus 7 Original Development] Pete7ate:
Really is a good thread, very useful.
[Nexus 7 Original Development] rushter:
Nexus 7 720p Camera Instructions - no PC needed (rooted users only)

720p video picture

Here are my instructions to do this without using a PC(for rooted users):

I used ES File Expolorer (nice program available in the play store)

1- Open ES File Explorer and head to /system/etc/

2- Find the file media_profiles.xml and copy it (long press the file and select copy from the menu)

3- Go into any other directory and paste it there (temporarily)

4- Go back to the /system/etc/ directory again and rename the media_profiles.xml to media_profiles.xml.old and save it (long press the file and select rename from the menu

5- Now go back to the directory you copied the file to and long press it. When the menu comes up select cut and go to the /system/etc directory and hit paste up at the top

6- Now just click on the file you just pasted and a list of editors will pop up.

7- Select ES Note Editor (it comes with ES File Explorer) and locate the section in the file where it says

<EncoderProfile quality="480p" fileFormat="3gp" duration="30">
<Video codec="h264"
bitRate="4000000"
width="640"
height="480"
frameRate="30" />

<Audio codec="aac"
bitRate="96000"
sampleRate="44100"
channels="1" />
</EncoderProfile>

8- Add this code right after

<EncoderProfile quality="720p" fileFormat="3gp" duration="30">
<Video codec="h264"
bitRate="16000000"
width="1280"
height="720"
frameRate="30" />

<Audio codec="aac"
bitRate="128000"
sampleRate="48000"
channels="1" />
</EncoderProfile>

9- Once added click the back button on the bottom and a menu will show up on the bottom that asks you to save click that.

10- Long press the file you just saved and select Properties at the bottom and make sure you give it the correct permissions (rw-r--r-- or chmod 644) by clicking the change button. There should be 4 check marks on that screen User read, User write, Group read, Other read. Click ok and ok again to save it.

11- Reboot and enjoy.

Don't thank me for this - thank hillbeast. If my instructions helped you then thank me too. Lol.

Thanks hillbeast - I also noticed that you cannot take a screenshot while in the camera program - gives you a sd card storage in use error. So I took this with my SGS2.
[Nexus 7 Original Development] 416inversed:
I tried this and now my Nexus 7 won't boot, I just get stuck on the glowing X boot animation.

I tried pushing a backup copy of media_profile.xml, but no luck.

I feel like a dumbass, as I haven't nandroided since the end of July.

Any ideas?
[Nexus 7 Original Development] hillbeast:
What do you mean by '!= high-quality video'? Do you mean it is blocky, or is it grainy from the camera itself? If it's blocky then I can turn the bitrate up some more to get a better quality encode and I can also switch to mp4 seing 3gp is a pretty rubbish container.

Yeah, anything Tegra 2+, Exynos 3xxx+, OMAP 36xx+ or whatever Qualcomm chip supports HD video encoding (I don't keep up with what Qualcomm are doing, but I'm pretty sure if you have a Snapdragon/Scorpion, you're good to go.

Thanks. I shall put your guide on the first page as well and credit you.

Try wiping dalvik-cache and cache, and if that still doesn't work then you need to reflash the system. You won't need to wipe your data, just restore /system from the backup.
[Nexus 7 Original Development] clark707:
Hey when i attempted to save i received an error. And i dont want to do this if its crashing everyone elses devices.
[Nexus 7 Original Development] ogdobber:
here is a flashable file for stock based aosp roms http://d-h.st/HBd

*edit should really work for all...
[Nexus 7 Original Development] ogdobber:
es explorer is a little more tricky than root explorer
[Nexus 7 Original Development] 416inversed:
System restore it was, thanks.
[Nexus 7 Original Development] hillbeast:
Thanks. I'll add a link on the first page.
[Nexus 7 Original Development] bennor3814:
See my post a few hours ago in this thread. Same thing happened to me earlier today. You may have to reload from a backup, if you made one. Or possibly reflash the Nexus 7 with a firmware file.
[Nexus 7 Original Development] clark707:
givin it a go

ROM: CleanRom 1.2

Kernel: Motley Kernel 1.1.1 build 218

ill be back when it crashes to moan and complain
[Nexus 7 Original Development] ogdobber:
hey hillbeast, post this one, I credited you in the updater-script

goo.im- http://tinyw.in/udKH

or from dev-host-http://d-h.st/hmD
[Nexus 7 Original Development] kitsunisan:
Should have known Simms would have an N7, lol. Nothing like pure Google on a tablet. Beats the hell out of y rooted Kindle.

Just applied the fix and rebooted, tanks for this. Seems to work great.
[Nexus 7 Original Development] clark707:
I can confirm success using this zip on my N7 :)
[Nexus 7 Original Development] rockethot:
Zip works great. Thanks!
[Nexus 7 Original Development] 416inversed:
Zip worked like charm.

Much thanks.
[Nexus 7 Original Development] hillbeast:
Cheers. I'll change the link. I'll use the Dev-Host link seeing it's no wait times and I want to support Dev-Host seeing they give RDs free accounts.
[Nexus 7 Original Development] kitsunisan:
I'm curious if the flashable zip addresses the timelapse issue blownart mentioned a couple of pages back.
[Nexus 7 Original Development] ogdobber:
dang it, uploading a fix right now
[Nexus 7 Original Development] kitsunisan:
Lol, keep it out, your patch does a great job already, this just gives the newbs something to work for. :p

Ahh hell, who am I kidding. I got lazy with my N7 and used the toolkit to root, first Android device I didn't go the hard way for.
[Nexus 7 Original Development] ogdobber:
ok hillbeast, this has the fix that doesn't crash the camera app when enabling time-lapse from 720.

thanks blownart for that fix and kitsunisan for pointing that out..

dev-host http://d-h.st/8Cw
[Nexus 7 Original Development] ogdobber:
haha of course i had to test and put myself in a camera crash spiral...

all good, just flash the latest over the top
[Nexus 7 Original Development] gr3yh0und:
Stupid me. I flash this MOD to MIUI Rom. Now I'm stuck at Boot Animation
[Nexus 7 Original Development] kitsunisan:
I would imagine you could just push the original file to your N7 via adb. Worst case I think just reflashing your rom will replace it. Wipe cache and dalvik and you should be good.
[Nexus 7 Original Development] gr3yh0und:
Yeah I'm reflashing it right now.
[Nexus 7 Original Development] hillbeast:
I should mention that I fixed the timelapse issue days before he mentioned it. I just never updated this thread.

8th Sept: http://xdaforums.com/showpost.php?p=31265365&postcount=55

6th Sept: http://review.cyanogenmod.com/#/c/22833/

I'm not trying to steal credit, just mentioning that I had already fixed this issue.
[Nexus 7 Original Development] fattire:
It's been merged.
[Nexus 7 Original Development] rushter:
Funny, I'm an idiot and ES was pretty easy.
[Nexus 7 Original Development] hillbeast:
Thanks for that. I shall keep this thread alive for those who use AOSP and such. I expect most ROM cookers will add this to their ROM in due time though,
[Nexus 7 Original Development] darkmatthew:
WTF?nexus 7 have camera?
[Nexus 7 Original Development] punshkin:
yes it does, it is front facing though so you have to hold it reverse or take 720p videos of yourself
[Nexus 7 Original Development] tkelly0727:
thank u so much, blooby hell the quality is way better than before. qreat work
[Nexus 7 Original Development] potblack2win:
ok hillbeast, this has the fix that doesn't crash the camera app when enabling time-lapse from 720.

thanks blownart for that fix and kitsunisan for pointing that out..

dev-host http://d-h.st/8Cw

Where do you push the file to /system/ system/apps or can you just install zip via Clockworkmod
[Nexus 7 Original Development] Noobla_Khan:
The link in your post is for flashing from CWM.
[Nexus 7 Original Development] ItBankRock:
Nice work! :D Now users can bring in 16:9 widescreen videos.
[Nexus 7 Original Development] jmdearras:
I apparently screwed up the edit, and my N7 hangs on the animation. Anyway to fix it from TWRP?

Jim
[Nexus 7 Original Development] donpippo:
flash this zip from recovery

---------- Post added at 08:57 PM ---------- Previous post was at 08:55 PM ----------

So can we replace 3gp with mp4 for save our video recording directly in mp4?

thanks
[Nexus 7 Original Development] blownart:
Sorry, I have a habit to check only the first post like for roms, as they allways update the first post. Anyway the credit is all yours. I just wanted to let people know how to fix this issue if they encounter it. I edited the file also on root explorer btw, I think its the easiest way.

EDIT:

Just changed the fileFormat="3gp" to fileFormat="mp4" and it works! Altought have to test it to see the difference between the formats.
[Nexus 7 Original Development] jmdearras:
how would I load that zip? USBMOUNT does not seem to work in TWRP.
[Nexus 7 Original Development] ogdobber:
good times TWRP:rolleyes:

bite the bullet and fastboot the factory images in
[Nexus 7 Original Development] jmdearras:
Fortunately I had a nandroid backup.
[Nexus 7 Original Development] dylyxcore:
what is the profile link on OP under the mod zip for?
[Nexus 7 Original Development] hillbeast:
Because he made the update.zip package. That's how I credit people.
[Nexus 7 Original Development] :
Camera FCs

Flashed the zip via CWM.

Installed Camera for N7 as shown in the OP.

Camera FCs. Everything has the right permissions set. Ideas?

Running stock rooted 4.1.1
[Nexus 7 Original Development] hillbeast:
Can you get a logcat of the crash?
[Nexus 7 Original Development] jmdearras:
No help, but I'm running the same setup and it works great.:confused:
[Nexus 7 Original Development] :
http://pastebin.com/7bnp9UEQ

EDIT:

This it?

{com.google.android.gallery3d/com.android.camera.Camera}; have you declared this activity in your AndroidManifest.xml?

I deleted gallery when I rooted. Should I reinstall the apk and odex, or can I declare the same activity?

EDIT #2:

Didn't feel like waiting for a response. After putting the apk and odex gallery files back, all is well :)
[Nexus 7 Original Development] dylyxcore:
The media profiles...
[Nexus 7 Original Development] ogdobber:
that is just the xml file (not flashable)...same as what the update zip flashes
[Nexus 7 Original Development] hillbeast:
Oh I thought you were talking about user profile. Should have quoted it so I knew what you were referring to.

That's just for ROM cookers so they don't need to make sense of my terrible instructions, or anyone wanting to do it the hard way.
[Nexus 7 Original Development] fredy915:
Finally got it working! You can def tell the diff :)
[Nexus 7 Original Development] Shano56:
in all fairness, same thing happened to me in cwm. not doing this, but something else. Still, I did indeed have to bite that bullet :p
[Nexus 7 Original Development] maverik410:
hi sorry not been on for a few days just clicked on your link and no file

cheers
[Nexus 7 Original Development] cvcduty:
Very nice... Thanks OP...

I simply downloaded your media_profile.xml from OP and used root explorer to replace it in the system/etc folder. Changed permissions, reboot... works perfect!!!

I have yet to find a good use for my camera but... always good to know there are ways to make things better... :good:
[Nexus 7 Original Development] backslashV:
So complicated

Can you please create an APK? I'm a newbie and don't understand those steps at all.:crying:
[Nexus 7 Original Development] scottharris4:
do you have to be rooted to do this?
[Nexus 7 Original Development] jmdearras:
Yes.

---------- Post added at 11:02 AM ---------- Previous post was at 11:01 AM ----------

It's not an apk kind of thing. If you are rooted, it's simple, just install the .zip file from recovery.
[Nexus 7 Original Development] RobHalford92:
So all I need to do is to go into cwm and install the 720p camera zip? Cos I've done that and I cant see any difference...I am using the camera app that came with paranoid android because the app suggested didn't work.
[Nexus 7 Original Development] giveen:
After flashing the zip, it worked!

However......big warning here......

I went to camera, not video, and changed resolution to 720, and now it cannot connect to camera. Doesn't see it and crashes the camera app.

Euroskank ROM on the elite kernel.
[Nexus 7 Original Development] cvcduty:
?... How did you change the resolution to 720 for camera? Do you mean video?

I am on stock rom (rootet & unlocked) and the resolution change is available for video only. You can select video res. to 480p or 720p. You can, however, change the picture res. from 1.3MP to 1MP to VGA to QVGA... is this what you mean? Either way, I am on stock JB and no issues here...

BTW, giveen... nice to see you here... I follow your work at the DS7 forum... thanks for your efforts... ^_^
[Nexus 7 Original Development] giveen:
No, I meant camera. In fact as soon as I tap on the arrow to change camera picture size it locks up. Only clearing cache restores camera.
[Nexus 7 Original Development] no6969el:
If anyone is stuck at the colored Nexus X logo after manually editing it just flash the zip file and then wipe/clear cache and dalvik. It will allow it to boot.

You can push it to the device using the tool kit while in recovery.
[Nexus 7 Original Development] cvcduty:
It's quite easy even if you are a newbie as you stated... OP has a lot of detailed instructions for those that can follow but I suppose it could be too much for others.

Anyway, there are a couple of super easy ways to accomplish this.

But first, you NEED to be ROOTED!!! Please search the threads on how to accomplish this. Once you are rooted, you are 90% of the way there to do this simple mod.

Method 1:

Download the .zip file from OP... Boot into CWM recovery->choose "Install zip from SDcard->Select the zip you downloaded->install->reboot.>done.

Method 2: (one I did)

Download the media_profile.xml.zip (This one is already modified as described in the OP - No need to add those command lines using HEX editorm, etc).

Extract the media_profile.xml file from this zipped file. Do not simply rename this by removing the extension. It's a zipped file!!!

Using RootExplorer (or other File managers that gives you Root access), navigate to /system/etc/.

Change the mode to allow RW (Read-Write) from RO (Read Only).

Find the original media_profile.xml and long hold on it and change the name to media_profile.xml.old (you can also make a copy of this file and place it somewhere safe (i.e. Ex_SD) in case you mess something up).

Now, copy the modified media_profile.xml (it's located in the SDcard/download folder if you download/extracted it like I mentioned earlier) into the /system/etc folder.

Long hold the file you just pasted and choose the option to change it's permissions. When the option box opens make sure you have check boxes so it reads like this... rw-r--r-- (- is given when you leave the permission box unchecked).

Change back the Permission for the folder to RO.

Reboot. Done.

Good luck!

---------- Post added at 01:39 PM ---------- Previous post was at 01:37 PM ----------

As I mentioned, I am on the stock N7 rom without any issues. I can change the camera resolutions without FC or lockup... It seems then the problem might be with the camera app in the rom you are using... maybe... not an expert here... :cyclops:
[Nexus 7 Original Development] RobHalford92:
I think after all that my ROM had it already the whole time

N7 Paranoid Android 2.11
[Nexus 7 Original Development] frescagod:
do you edit media_profiles.xml in the \etc folder or do you edit the copy (that i pasted to \sdcard)? then, paste the updated media_profiles.xml in \etc?

i'm mixing something up because ES won't let me edit, save, or rename the file in \etc. i'm rooted, stock ROM.

thanks for any help!
[Nexus 7 Original Development] cvcduty:
Just download the media_profile.xml.zip from OP and extract... copy and paste the extracted file into the /system/etc/ folder, change the permissions and you are good to go after you reboot. Just either rename or copy the original for safe keeping.

If ES won't let you, it means you did not change the folder permissions to allow you to do so. It needs to be set to RW (Read-Write) from RO (Read Only).
[Nexus 7 Original Development] frescagod:
if i long press \etc and go to properties, permissions are rwx r-x r-x, and if i long press media_profiles.xml, permissions are rw- r-- r--. it won't let me change either of these. i also can't overwrite media_profiles.xml in the \etc folder.
[Nexus 7 Original Development] cvcduty:
Ok... someone can help here.. I am not familiar with ES, as I use RootExplorer, but if you have root access, there should be an option to change the folder permission to Read-Write to allow you to do this.

Here is the description of the ES from Android Market...

"Root explorer feature (enable it from settings). It is the ultimate file management tools for root users. You might access the whole file system and data directories, and change permissions."

So, it seems that you need to enable it from settings...