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.

xperator
  • 457
  • 2
  • 12
  • 24
  • [This](http://nginx.org/en/docs/http/ngx_http_mp4_module.html) docs page says nginx supports H.264/AAC files. [Youtube](http://en.wikipedia.org/wiki/YouTube#Quality_and_codecs) seems to use H.264 mostly - try to convert your videos to it. – Dmitry Verkhoturov Apr 28 '12 at 08: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](http://www.mirovideoconverter.com/) with codecs H264 and WebM and tell me your results. – Dmitry Verkhoturov Apr 28 '12 at 17:41
  • @DmitryPaskal I downloaded the program. I assume by saying H264 you are talking about mp4, right ? I found 2 item in conversation list. "Mp4 video" and "WebM (vp8)". I converted file to both formats. I uploaded the Mp4 file and still not working. Currently uploading WebM file. But WebM is not my taste. Because users are gonna watch the mp4 video and might download it so it should be able to play in their system. – xperator Apr 28 '12 at 18:21
  • let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/3262/discussion-between-xperator-and-dmitry-paskal) – xperator Apr 28 '12 at 18:39

2 Answers2

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.

xperator
  • 457
  • 2
  • 12
  • 24
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