5

I'm trying to use <video> tag feature. I've encoded my file with ffmpeg:

ffmpeg -i 1.vob -f ogg -vcodec libtheora -b 800k -g 300 -acodec libvorbis -ab 128k out.ogv

I've placed this text in index.html:
<video src="out.ogv" controls></video>

I've loaded this files to nginx document root and opened index.html in Firefox 3.5. I see the first frame, see controls, but can't play video. This video plays good even from my server.

How should I encode video to view it in browser?

UPD:

If I start playing video from the middle, everything works fine.

lexsys
  • 2,863
  • 5
  • 30
  • 34

9 Answers9

3

According to this page you have to add the mime types to the server, in Apache it would be:

AddType video/ogg          .ogv
AddType application/ogg    .ogg
solarc
  • 141
  • 2
2

Um just curious, have you tried just renaming the extension to .ogg instead of .ogm?

Edit:

Have you had a chance to read this page?

Avery Payne
  • 14,326
  • 1
  • 48
  • 87
0

The most detailed resource I've found is at Dive into HTML5.

blahdiblah
  • 179
  • 1
  • 7
TRiG
  • 1,167
  • 2
  • 13
  • 30
0

i haven't really researched html5 yet (still waiting for it to be final) but i believe you need to have your html read

<video src="out.ogv" controls="true" type="video/ogg"></video>
Keith
  • 2,419
  • 1
  • 22
  • 18
0

I don't know exactly your problem. The only thing I have seen that the video which is working uses a framerate of 30 fps. And according to the man-page ffmpeg would use 25:

       -r fps
       Set frame rate (Hz value, fraction or abbreviation), (default =
       25).

i am not an expert in this would this is the only thing I found while looking at the working file.

Raffael Luthiger
  • 2,011
  • 2
  • 17
  • 26
0

If you play it from the middle and it works, sounds to me like there's nothing wrong with the HTML, but a problem with the video itself.

I'm not familiar with the OGG format for video, but I've used plenty of FLV's streaming from Adobe FMS, and we had similar issues with missing META data. Missing meta at the beginning of the file = certain death, but if you started playing the file from the middle it was A-OK.

Mark Henderson
  • 68,316
  • 31
  • 175
  • 255
  • I've got to remember that - we just installed Adobe FMS at work and I'll be responsible for managing training videos. – AnonJr Aug 14 '09 at 11:16
0

I have had good success with ffmped2theora where plain ffmpeg could not help me:

sudo apt-get install ffmped2theora
ffmpeg2theora 1.vob

will convert 1.vob to 1.ogv

AgentK
  • 411
  • 2
  • 4
0

It's probably your video then, works fine for me when I name it video.ogg under Firefox 3.5. Try exporting some other ogg videos, perhaps using various exporting programs just to test, and see if you can get any playing. All I did was use the following as an index.html file in Apache's document root:

<HTML>
<BODY>
omg HTML5 video test, here it is:
<video src="video.ogg" controls="true" type="video/ogg"></video>
</BODY>
</HTML>
Chealion
  • 5,713
  • 27
  • 29
-2

Its not a great idea to use the video tag because although the tag itself is still in, the requirement for a standard codec has been dropped. Some will support ogg, some will support H.264, others neither. Also hardware acceleration for Theora is limited so things like netbooks and phones won't handle it very well.

JamesRyan
  • 8,138
  • 2
  • 24
  • 36