0

I create a video from frames, with no sound with ffmpeg:

ffmpeg -f image2 -r 1 -i "img%d.png" -vcodec libx264 -pix_fmt yuv420p -movflags faststart x.mp4

on desktop, it goes well. But on smartphone, Firefox say:

no video with supported format and MIME type found.

The source images are 1024x768. What could I do? HTML5 is:

<video controls autoplay>
<source type="video/mp4" src="/x.mp4"></source>
</video>
John Smith
  • 6,367
  • 12
  • 54
  • 106

2 Answers2

2
  1. You must not use the type attribute when calling the video.

  2. You must manually call video.play()

  3. The video must be encoded to some quite strict parameters; using the iPhone setting on Handbrake with the 'Web Optimized' button checked usually does the trick.

Here's the html:

<video id="video" autobuffer height="240" width="360">
<source src="BigBuck.m4v">
<source src="BigBuck.webm" type="video/webm">
<source src="BigBuck.theora.ogv" type="video/ogg">
</video>

Here's the css:

var video = document.getElementById('video');
video.addEventListener('click',function(){
  video.play();
},false);

Please have a look at this. HTML5 <video> element on Android

Community
  • 1
  • 1
2

Firefox on mobile has patchy support for MP4 files. You will need to convert your source file to OGV and WEBM formats too to ensure it can play at least one codec. Then include in your HTML like so:

<video controls autoplay>
    <source type="video/mp4" src="/x.mp4"></source>
    <source type="video/ogv" src="/x.ogv"></source>
    <source type="video/webm" src="/x.webm"></source>
</video>
Jonathon Blok
  • 679
  • 4
  • 13