Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I learned how to compile nginx with mp4 module. I also added proper directive in my website conf.

I am trying to play a mp4 using JW player and flow player. But the video doesn't buffer and play like youtube and similar sites. It takes a long time to start play. It seems it downloads the whole video and then plays it. I have tried changing the buffer limits but no luck.

I downloaded a youtube video and tried comparing it with my own video. The video from youtube starts playing immediate but my converted video doesn't. Maybe nginx only plays mp4 files in a specific codec and format ?

Note that I am not making a tube site or anything similar. So please don't suggest to migrate from nginx.

share|improve this question
This docs page says nginx supports H.264/AAC files. Youtube seems to use H.264 mostly - try to convert your videos to it. – Dmitry Verkhoturov Apr 28 '12 at 8:41
@Dmitry Paskal I tried converting to the same codec used by a youtube file but it's not working. I compared both files in MediaInfo, very similar in details and almost same size. That's weird the youtube video starts playing normal while my own converted ones takes very long. I think I am missing something in converting the files. No sure what it is. Note that I tried various youtube files and made sure there is no browser cache problem. Full deleted history and refreshed. What's your opinion ? – xperator Apr 28 '12 at 12:53
You're not revealing main information about that - which program you are using for conventing your videos and what is your conventing settings. Please upload screenshot with settings and program information. – Dmitry Verkhoturov Apr 28 '12 at 17:32
@DmitryPaskal I tried many programs. Movavi Video Converter, Imtoo video converter, Xilisoft video converter, Freemake video converter, Any video converter. Most of them have a youtube convert preset. So I tried all of them and I hoped it would be close to a youtube codec video. And If using a custom preset, It's H264 250Kbit rate 25fps, AAC audio 96Kbit. If you are really able to solve this I would be glad to meet you in chat so we can speed up things. Thanks again! – xperator Apr 28 '12 at 17:39
Try Miro video converter with codecs H264 and WebM and tell me your results. – Dmitry Verkhoturov Apr 28 '12 at 17:41
up vote 1 down vote accepted

Ok I found the cause of the problem. For anyone who is having the same problem. Actually the issue is not related to nginx, web player(JW player in my case) or the video codecs you are using. It's the video file itself.

Found this in JW player's Troubleshooting Guide :

I can't seek: I'm using an MP4 file

If your MP4 files cannot be seeked before they are completely downloaded, you will have to fix the MOOV atom (it contains the seeking information) located at the end of your video. Use this little application to parse your videos and add the necessary cue points.

The application name is QTIndexSwapper 2.

share|improve this answer
If you use ffmpeg you should move the MOOV atom to the beginning like this -movflags faststart {output}.mp4 – Abdelmoula Nami Feb 28 '15 at 2:48

This python script should help you to add Quicktime atom positioning for you video files. It allows rewind and seeking. Quicktime atom positioning in Python for fast streaming

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.