Search code examples
firefoxvideohtml5-videovideo-encodingwebm

.webm video plays in Chrome and Opera but not Firefox


I converted some .mp4 files to .webm with Miro. They play in Chrome and Opera but they do not play in Firefox 16. Firefox has supported .webm since FF 4. I tested video.canPlayType() and it returns "probably". I know that the MIME types are correct in .htaccess. I downloaded the a test .webm file from html5rocks and uploaded it to the same server and it played fine in FF, which makes me think it must be the encoding. I tried converting the videos multiple times and still no dice. Can anyone think of what would cause the them to not work in FF? Is there a more reliable way to convert videos to .webm?

Chrome_ImF.webm <== works in FF

amber-miro.webm <== does not work in FF

costa-miro.webm <== does not work in FF


Solution

  • There seems to be no problem with the encoding, however there are some errors with the file format on the webm files you created with Miro. I suggest using ffmpeg.

    I've tested amber.webm which you provided as a sample. I used ffmpeg to re-format it into webm, without encoding, using the commandline:

    ffmpeg -i amber.webm -acodec copy -vcodec copy amber1.webm
    

    And the resulting file seems to play well in Firefox.

    To directly convert .mov to .webm via ffmpeg you can use:

    ffmpeg -i amber.mov -qscale 0 amber.webm
    

    -qscale 0 is meant to retain the highest quality. See the ffmpeg docs.