views:

575

answers:

4

Hi,

I have received the following video file from a camera (from security camera) http://dl.dropbox.com/u/1369478/tmw/recording.264

How can i view the content? Based on extension i think that is a H264 file. Is there a way to play this on the browser with HTML5?

Regards

+7  A: 

Hmm.. From the looks of it it doesn't look like a H264 file..

Running it through MediaInfo, I got this:

Video
Format : AVC
Format/Info : Advanced Video Codec
Format profile : [email protected]
Format settings, CABAC : No
Format settings, ReFrames : 1 frame
Width : 352 pixels
Height : 288 pixels
Display aspect ratio : 1.222
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive

Apart from it all, you have to know that not all browsers support H264 in the <video> element.. Some of them decided to hold on to ogg, so it's not really going to be available everywhere :S

Here's a table that shows that H264 video os only supported by Chrome and Safari: http://www.findmebyip.com/litmus#html5-video-codecs

In any case, if you do get a video file, and you want to embed it in a browser, and you know that you'll access it from a compatible browser (or if you get H264 AND ogg versions), you can use this:

<video src="http://link/to/video/file" controls="controls" width="500"></video>

Or if you have multiple formats:

<video controls="controls" width="500">
    <!-- if Firefox -->
    <source src="video.ogg" type="video/ogg" />
    <!-- if Safari/Chrome-->
    <source src="video.mp4" type="video/mp4" />
</video>

Check out this link for some more examples, and how to add flash / flat image fallback for browsers that don't support it http://net.tutsplus.com/tutorials/html-css-techniques/quick-tip-html-5-video-with-a-fallback-to-flash/

UPD: As I understood, the file that you hosted up there is an example, not the actual file that you want to have in your page.. The file you have there has a single frame, so it might be a jpeg image, and it would make no difference :P

If you DO have an actual video file with the same format, you might try to inject it in the page using the snippets above. If the browser coughs it up, and doesn't want to play it (remember to check it with Chrome or Safari), then you can just convert the file using one of the free encoders on the net. For example, I've been using the free H.264 encoder to convert my video files to H.264 :)

Good luck!

UPD2: I actually took and encoded the file... The file size dropped from 1.766MB to 34KB. It's the same video, 1 frame, same size... but the 1 frame in the video is looped for ~30 seconds :) So I see a long 30 sec background there.. I guess you really SHOULD encode the file, even if it's in H.264 already, because the computer will encode video files a LOT better, and you'll bet (almost) the same picture quality, with a much smaller file size.

Artiom Chilaru
AVC is indeed another name for H.264 video. See: http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC. I would guess that the file plays OK in Safari/Chrome assuming the container is a valid MP4 format.
Coxy
Hmm, thanks.. You're actually right there )I kind of missed it, I guess
Artiom Chilaru
Thanks Artiom, can you please give me the actual file that you converted. Also how did you convert the video? Can I convert the video in linux.I can see the video with activex control that these videos have multiple frames and they play like a video.More videos http://dl.dropbox.com/u/1369478/tmw/recfile_-100505-202446-202505-20020300.264http://dl.dropbox.com/u/1369478/tmw/recfile_-100507-174904-174914-20020300.264
ToughPal
Hmm.. I checked out all 3 files, and saw the same results..Could you tell me the model (or at least the manufacturer) of the security camera you have? It might be a proprietary container file, but they usually have convertors available for download
Artiom Chilaru
they are a custom manufacturer of cameras so they dont have a modal number etc and they are not popular. How did you try to convert the video to ogg format?
ToughPal
I didn't try converting it to .ogg yet, as all I see in the file in grey, but at this moment I'm pretty certain that it should actually contain something useful (after all.. it's over 1MB in size..). This means it's not using a standard video container.. If you at least tell me the manufacturer name, I could look it up, and maybe convert the file to a regular .avi.. after that it'll be easy to encode it to H.264 and OGG, that can be used by the browser :)
Artiom Chilaru
ToughPal
Can this system store the files in any other format? I read on some site that some dude also managed to get weird .264 files from his cctv-like system, but in the web interface for it he could download these files as .avi.. Unfortunately I can't find any tools for meian hw at all, so unless you have an app (maybe on the CD that came with it) to get standard video files - I'm a bit at a loss :(
Artiom Chilaru
Hi Artiom, the camera developer gave this Activex http://dl.dropbox.com/u/1275078/tmw/Focus.cab They say we can use the MAPLAY_SetDecCallBack feature from the Decoder API to get the raw data in YUV420 format. Any ideas on what we can do?
ToughPal
It's definitely a non-standard container format. A hexedit of the file shows a completely different header to what you would expect in a H.264/MP4/AVC file. The .dlls in the .cab look promising but, without documentation, it would be a nightmare trying to code anything against them. Google gives no results for their names so they aren't anything standard either.
DanK
I second that.. Haven't found anything really useful for the .dll files, and the .264 don't look like anything valid (though Media Info still "kind of" identifies them.. One of my previous thoughts was that the file was corrupted, but 3 in a row, and with the same issue... Unlikely.. I guess it is some custom/weird container, even id there is some h.264 stream encoded deep inside :P
Artiom Chilaru
@DanK and @Artiom I was told by the camera people that we can use the ActiveX in link above http://dl.dropbox.com/u/1275078/tmw/Focus.cab and then MAPLAY_SetDecCallBack feature from the Decoder API to get the raw data in YUV420 format. Will that work? How can I call that ActiveX?
ToughPal
A: 

If this still isn't working, taking the code from what Artiom posted above, you may want to include the codec in the type attribute, e.g.:

<video autoplay controls width="512" height="300">
  <source src='myVideo.theora.ogg' type='video/ogg; codecs="theora, vorbis"'>
  <source src='myVideo.mp4' type='video/mp4; codecs="mp4v.20.8, samr"'>
</video>

For more info see: html5 laboratory - using the video element

Ian Devlin
Thanks, tried<video controls="controls" width="500"> <source src="recording.264" type="video/mp4" codecs="mp4v.20.8, samr"></video>Still does not work for the video. Cant view it in chrome / firefox.
ToughPal
@ToughPal - Firefox doesn't support H.264, as I stated in my answer )You can encode the file to Ogg for it to work in Ff. Check out http://www.vorbis.com/ for more info + encoders )
Artiom Chilaru
As Artiom said, H.264 isn't supported by Firefox nor Chrome, and again as he pointed out quite correctly, they support Ogg only. Follow this mans advice, he knows what he's talking about :-)
Ian Devlin
A: 

To play it I suggest the very good VLC Player which can (like most good video players) play direct from a URL.

PS: It seems this is the kind of question to put on http://superuser.com

Wernight
Tried it, but it's not the issue here.The .264 file that he gets is not a regular H.264 file, and while not throwing any errors - doesn't play correctly.. It identifies as having a single frame in the file, which is obviously wrong.
Artiom Chilaru
You may try some others:- SMPlayer (http://portableapps.com/node/18796)- MPlayer (http://portableapps.com/apps/music_video/mplayer_portable)- H.264 codec via CCCP (http://www.cccp-project.net/)
Wernight
tried all no luck. The CCCP project also says "Cannot render file"
ToughPal
@Artiom: Well, when I tried to play the file in VLC player (0.9.9) it certainly threw errors. Try increasing the verbosity level of messages to 2 and you will notice. Perhaps the file is not valid.
puffadder
A: 

Options,

Hope this helps.

If not, please let us know so that we can find another solution. But these 2 things i am using since last 4 to 5 years. And believe me it plats anything you have.

thanks.

Paarth