sergstetsuk / CosyDVR

android open source auto DVR
Other
51 stars 23 forks source link

Front camera and portrait->landscape crop #21

Open BlueMax opened 9 years ago

BlueMax commented 9 years ago

Hi, can you add front camera support and (if possible) an option to smart convert portrait recordings (eg. when having phone in breast pocket). The smart convert would convert (crop) a video from 1080x1920 to 1080x608 (16:9) or similar. I think i've seen such a recorder already somewhere that does that in realtime (postprocessing wouldn't make sense as there are enough tools already doing this).

What do you think?

sergstetsuk commented 9 years ago

You think about autorotation or settings in preferenses dialog?

BlueMax commented 9 years ago

New settings (feature requests).

Autorotation wouldn't help as we want to convert a portrait oriented video (9:16) to landscape orientation (16:9). For this we must crop/delete top and bottom part of the picture. Then we can watch a portrait recorded video on landscape fullscreen without letterboxes (black borders).

Front camera support is probably easy but I'm not sure if that video processing (cropping) is possible. Maybe these links are helpful: http://stackoverflow.com/questions/8601982/is-it-possible-to-crop-camera-preview https://source.android.com/devices/camera/camera3_crop_reprocess.html

Some approaches come into my mind: 1) Full h/w processing (cropping by api. Camera2 api?) 2) Partial h/w (h/w decode or direct raw stream -> s/w crop (ffmpeg?) -> h/w encode)

BlueMax commented 9 years ago

Apps that already use this are:

The apps are GPU accelerated that is a good thing. I hope you find it useful as well and consider implementing it. This way you can put your device in the pocket (horizontally) and walk through the streets. :-)