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.