Crunch Mode Blog - A State of Mind by Developers at D2Soft Technologies

Like us on Facebook

Using the HTML Media Capture to record video on Android and iOS

Update 2014-05-14: we have released the Nimbb Library for iOS to be used in Xcode projects with Objective-C.  You can also learn more with our tutorial. This can be a solution if you want to add video recording to your iOS app.

Since 9 May 2013, the HTML Media Capture specification is a W3C Candidate Recommendation.  In this post, we will give our opinion regarding this feature that extends the <input> elements with a capture attribute.

First off, let's see how to use it in our HTML page.  In our case, it is the aspect of being able to capture video using the device's local video camera that interests us.

<form action="server.cgi" method="post" enctype="multipart/form-data">
  <input type="file" name="video" accept="video/*" capture>
  <input type="submit" value="Upload">

Try this code from a mobile device.  Once you click the "Choose file" button, a camera recorder will open and you can start recording a video.  Depending on your device, you might be prompted to select a program or option.

Now, as a developer, this new capture attribute is exciting.  From an end-user's point, it is quite simple to use.  However, our testing has shown many drawbacks.

Drawbacks include the inability to specify parameters to make the recorded video useful (recording time limit, video quality or a file format).  In fact, each device records a video in its own way.  On one Android device you might get a 3GP file format and on an iPad an MP4 file format.  The biggest issue is the file size, as the device will simply record in the highest quality possible.  This means a short 10-second video can quickly be over 20MB.

Posting large files over a 3G network connection is not realistic at this point.  In addition to using too much data, it takes too much time to upload.  For most developers, this cannot be a viable solution.  Unfortunately, our conclusion on HTML Media Capture is that in its current recommendation, it is not applicable to video recording.

For recording video on iOS or Android, the best solution is to build a custom application that will force the necessary limitations (in time, size and format) on the client's mobile device.  That's what we did by introducing our Nimbb Video Recorder app for iOS.  Users simply download our free application and can start recording videos.  And by using our app, developers can have full control over videos and integrate them with their Nimbb API account.