<p>Unfortunately due to patent/licensing issues<sup>1</sup>, MP4 playback is not supported natively in all browsers. That's where file format redundancy comes into play; if one file format is not able to be natively loaded by a system a backup version may be able to work.</p>

<p>I have found that certain browsers will be able to run files encoded with the .webm container using VP8 plus Vorbis for audio and video, respectively, out of the box while using HTML5 players.<sup>2</sup></p>

<p>Citations</p>

<hr />

<p><sup>1</sup> <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats#Browser_compatibility" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats#Browser_compatibility</a></p>

<p><sup>2</sup> <a href="https://en.wikipedia.org/wiki/HTML5_video#Multiple_sources" rel="nofollow">https://en.wikipedia.org/wiki/HTML5_video#Multiple_sources</a></p>

CC BY-SA 3.0
2015-07-25T05:05:40.357Z
Doesn't seem to be that issue as non-encoded videos are playing fine, and if those videos were uniformly non-MP4, the OP would have noticed.
Gyan
CC BY-SA 3.0
2015-07-25T09:15:06.763Z
See Browser Compatibility section here https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats
Anatoly
CC BY-SA 3.0
2015-07-24T20:45:53.663Z
2015-07-24T20:45:53.663Z
tmp
<p>I have set up a server to upload and play videos. I used django/python as the scripting language, and nginx and gunicorn as the webserver. I am using <a href="http://www.videojs.com/" rel="nofollow">videojs</a> as the video player.</p>

<p>For h264 mp4 I tried this command:</p>

<pre><code>ffmpeg -i inputfile.avi -codec:v libx264 -profile:v baseline -preset slow -b:v 250k -maxrate 250k -bufsize 500k -vf scale=-1:360 -threads 0 -codec:a libfdk_aac -movflags +faststart output.mp4
</code></pre>

<p>But its only playing on desktop browsers and not on mobile browsers (except only on firefox android browser).</p>

<p>Here are some points that I gathered along the way:</p>

<ol>
<li>Some of the videos which I downloaded from youtube and uploaded it on the server without encoding are playing nicely on all the browsers.</li>
<li>However if I encode the same video (youtube video) and upload it on the server, it does not play on the mobile devices but only on desktop browsers.</li>
<li>Videos which I took from my mobile (samsung s4 and iphone 6), and encode it with ffmpeg are not playing on the mobile browsers, only on desktop browsers.</li>
<li>But, the url of the same videos (which I took from mobile) which are hosted on amazon s3 are playing nicely on all the browsers (even the non encoded videos).</li>
</ol>

<p>What am I missing? I was really hoping if you could guide me and help me to solve the problem. Thank you.</p>

<ffmpeg><transcoding><webvideos>
ffmpeg encoded videos are not playing on mobile browser
Robin
# ffmpeg encoded videos are not playing on mobile browser

(Asked by: username_0 on 2015-07-23)

I have set up a server to upload and play videos. I used django/python as the scripting language, and nginx and gunicorn as the webserver. I am using videojs as the video player.
For h264 mp4 I tried this command:
ffmpeg -i inputfile.avi -codec:v libx264 -profile:v baseline -preset slow -b:v 250k -maxrate 250k -bufsize 500k -vf scale=-1:360 -threads 0 -codec:a libfdk_aac -movflags +faststart output.mp4

But its only playing on desktop browsers and not on mobile browsers (except only on firefox android browser).
Here are some points that I gathered along the way:

Some of the videos which I downloaded from youtube and uploaded it on the server without encoding are playing nicely on all the browsers.
However if I encode the same video (youtube video) and upload it on the server, it does not play on the mobile devices but only on desktop browsers.
Videos which I took from my mobile (samsung s4 and iphone 6), and encode it with ffmpeg are not playing on the mobile browsers, only on desktop browsers.
But, the url of the same videos (which I took from mobile) which are hosted on amazon s3 are playing nicely on all the browsers (even the non encoded videos).

What am I missing? I was really hoping if you could guide me and help me to solve the problem. Thank you.

**Tags:** ffmpeg, transcoding, webvideos


---

## 1 answers

### Answer by username_1 on 2015-07-24. Score: 0 | Accepted answer

Unfortunately due to patent/licensing issues1, MP4 playback is not supported natively in all browsers. That's where file format redundancy comes into play; if one file format is not able to be natively loaded by a system a backup version may be able to work.

I have found that certain browsers will be able to run files encoded with the .webm container using VP8 plus Vorbis for audio and video, respectively, out of the box while using HTML5 players.2

Citations

---

1 <https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats#Browser_compatibility>

2 <https://en.wikipedia.org/wiki/HTML5_video#Multiple_sources>

> **Comments:**
> **username_2**: Doesn't seem to be that issue as non-encoded videos are playing fine, and if those videos were uniformly non-MP4, the OP would have noticed.  
> **username_3**: See Browser Compatibility section here https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats  

---

