The H.264 encoder on the Pi outputs an H.264 NAL stream which lacks all sorts of information including (rather importantly) the framerate, without which one cannot calculate the video length. This is why you can, for example, record a video with raspivid at 1fps but if you play it back in VLC it'll play back at 24fps because that's what VLC defaults to in the absence of such information.
This is why it's generally necessary to use some tool to wrap the output up in something more useful like an MP4 container (which will contain things like framerate). The easiest method for doing this at the moment (on a Pi) is to use MP4Box:
$ sudo apt-get install gpac
$ MP4Box -add v.h264 v.mp4
This doesn't perform any re-encoding; it simply wraps the raspivid output in an MP4, so it's an extremely fast operation.
Why does the Pi's camera produce such a low level stream instead of something like an MP4 file? I don't know for certain but this would be my guess:
Remember that the Pi's camera is fundamentally a mobile phone camera. On a mobile phone one would want to combine the video output of the H.264 encoder with some encoded audio stream (something like AAC) and output the result as an MP4 file. In such cases you wouldn't want the camera firmware to produce an MP4 file as you'd just have to decode that to extract the video stream before muxing it with the audio stream. Hence, the camera's encoder firmware produces this relatively low level stream and expects the caller to handle wrapping it up in something more end user friendly like an MP4 file.