Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi!How to differentiate type of action within onActivityResult? #29

Open
bakhman1981 opened this issue Jul 10, 2017 · 5 comments
Open

Comments

@bakhman1981
Copy link

bakhman1981 commented Jul 10, 2017

HI!
this is not issue, i think it already exist.
How can I understand Photo or Video was captured? (of course I can check uri extension but...)

And also can I set Video settings without 'setMediaAction'? I mean that by default Photo mode will be shown , but when I select Video mode - restrictions will be applied. is it possible?

@memfis19
Copy link
Owner

Hi, well depends how do you use it. I suppose you are using not custom approach, so Annca does not provide any info in onActivityResult, because it is quite easy to retrieve file extension or mime-type with standart tools i.e. File (in case you really need it - I'll add, but not in nearest time, sorry). As for settings, sure you pass general setting both for photo and video actions. In case something does not work - can you send me please how do you set settings.

@bakhman1981
Copy link
Author

bakhman1981 commented Jul 11, 2017 via email

@bakhman1981
Copy link
Author

bakhman1981 commented Jul 11, 2017 via email

@memfis19
Copy link
Owner

Hi, well yes, it is thing to improve and I believe I mentioned it in README. I don't know, do you know , but device camera has predefined amount of supported sizes for preview, photo and video (and they are different on different devices). So in Annca was selected more simple approach for end using - MEDIA_QUALITY. And it has few values: low, medium, high. Depends on video sizes this MEDIA_QUALITY is evaluated. Algorithm is very simple just split the supported sizes on MEDIA_QUALITY amounts. I.e. you have next supported values: 144x144, 256x372, 320x480, 480x640, 480x720, 720x1280, 1080x1920. So Annca will use 144 for low, 1080 for hight and 480 for medium. Beside this to start record we need provide additional setting such as audio and video bitrate, codec etc. This values are retrieved from CamcorderProfile profiles and matched to the MEDIA_QUALITY sizes (note that CamcorderProfile may return profile which is not supported by camera, so it is search for best matching option), and then used all this values. That's why the difference between LOW and MEDUIM quality so big, 144 audio and video bitrates very low and for 480p quite big. Exceptional case is limitation by file size in this case audio and video bitrates are decreasing until video will fit file size or will be used the lowest possible values that camera supports.

@bakhman1981
Copy link
Author

bakhman1981 commented Aug 5, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants