Aspect ratio of video recorded by showCamera

You must Login before you can answer or comment on any questions.

When recording a video with the normal iPhone camera, the videos are 16:9.

When recording a video using Titanium.Media.showCamera, the videos are 4:3 and there is no parameter to set either aspect ratio.

How do I set Titanium.Media.showCamera to record in 16:9?

I tried with a sample project that contains only the sample code below and it does record at 4:3.

There is no documentation whatsoever regarding video aspect ratio. This does not seem to be controlled by any parameter on the device and there is no parameter for aspect ratio in showCamera.

I checked the "Photos" app to preview and the videos were 4:3. I emailed myself a test video and it was consistant.

Sample code:

Titanium.Media.showCamera({
    success : function(event) {
        Ti.Media.saveToPhotoGallery(event.media);
    },
    showControls : true,
    mediaTypes : Ti.Media.MEDIA_TYPE_VIDEO,
    videoQuality : Ti.Media.QUALITY_MEDIUM,
    autohide : true,
    videoMaximumDuration : 60 * 1000
});

— asked 10 months ago by Tony Nimeh
0 Comments

1 Answer

Accepted Answer

Hi Tony, you can set video quality using videoQuality property to QUALITY_HIGH and it will give you desired result. or you can try other values as well from here.

Your Answer

Think you can help? Login to answer this question!