3

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.

7
  • This docs page says nginx supports H.264/AAC files. Youtube seems to use H.264 mostly - try to convert your videos to it. Apr 28, 2012 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 ?
    – Hassan
    Apr 28, 2012 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. Apr 28, 2012 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!
    – Hassan
    Apr 28, 2012 at 17:39
  • Try Miro video converter with codecs H264 and WebM and tell me your results. Apr 28, 2012 at 17:41

2 Answers 2

2

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.

1
  • 1
    If you use ffmpeg you should move the MOOV atom to the beginning like this -movflags faststart {output}.mp4 Feb 28, 2015 at 2:48
1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .