13

I'm currently trying to record a video with the MediaRecorder and a Camera. But for my Application, I need to record a video in square-format, like Instagram does with Pictures, to be independet of device orientation.

Is there any way to automatically crop and preview a video in a square-resoultion (f.i. 800x800) or do I have to crop the video manually (I have FFMPEG available on the Android-Device)?

jhbruhn
  • 868
  • 2
  • 10
  • 23
  • I have the same issue, i have to record as a square, when I'm in portrait mode, if you find something, please let me know. I will do the same – rosu alin Apr 15 '13 at 09:27
  • Hey, guys, aren't you both interviewing for a work in smrtlabs? (= I have same task – PVoLan Apr 20 '13 at 08:28
  • This question might be outdated in the meantime, but has this ever been solved in an elegant way? – André Aug 24 '14 at 17:51
  • Unfortunately, I've never found a solution. – jhbruhn Aug 25 '14 at 20:25
  • To get a square video, I've had to create a box overlay on a camera surface view, measure the position and size against the device screen size, then use ffmpeg to crop the video using the box overlay coords. – speedynomads Sep 11 '15 at 11:20
  • try this its best square camera for me https://github.com/CrazyOrr/FFmpegRecorder – Hitesh Gehlot Aug 02 '17 at 12:21

1 Answers1

0

Using an ImageView, I can set a square height and width (say 100dip x 100dip). Then using android:scaleType="centerCrop" gives me an image which is cropped to square regardless of aspect ratio.

Opal
  • 81,889
  • 28
  • 189
  • 210
Hiren
  • 11
  • 3