So i allow uploads of 2Gigs and i do streaming and with files being
streamed
that are 2gigs in size you can imagine things could of been loading a
bit
slow.
Now itpp2012 mentioned to me in another area of the forum “(mapping a
drive
is slow, use direct ip access)” And with my drives mapped still as soon
as i
change this value parameters value to be 2G large video files are served
super fast.
Can anyone tell me if it is bad that i set this value to be so large ?
I serve allot of media files from the server they are all quick and fine
just this 1.5GB (7 hour long) mp4 file to be served / loaded seems to
take
44 seconds and i also do not use the mp4; module.
What a strange bug i am totaly confused because the way i generate media
i
also have a webm file of the same video and the webm you go to the url
it
may only be 900mb but its the same length (7 hours) and it loads
instantly.
The mp4 1.5gb 7hour long takes between 43 - 50 seconds before you can
start
to play the video.
Sounds like a client issue which isn’t dealing with partial downloads,
had
the same thing with an old vlc and twd/s5, used the latest vlc and it
started playing after 2 seconds (2.8gb).
If a client tells nginx to get it all it will send it all.
Sorry to keep posting this all seperatly but what makes this even
stranger
once 44 or so seconds pass and the media starts playing i can skip
anywhere
i like in the file and its fast as soon as i refresh and redownload i
have
to wait again.
I dont know why there are other files just as large but not mp4’s that
download fast and can stream fast but with large mp4’s nginx seems to
either
wait or buffer or something first what i dont see how it can be
buffering
when i do not use the mp4; module.
I have no idea how it works in detail but I can assume when a server
gets a
request the server will respond with an answer in other words the
client
has to tell the server how much it wants and the server has to be able
to
send partial content when configured to do so as by rtmp design (well
not
actually by design but by rtmp upstream who feeds nginx/rtmp) its a
chain
and everyone needs to play nice or you will get it all at once.
Strange i think you are right i access the same mp4 size and vide length
on
other sites and they all do the same thing take like upto a miniute
before
they will play but a webm will play instantly.
Any idea how i can fix this ?
But what makes it strange is it does not happen with YouTube videos that
are
10-48 hours long but then i think youtube uses rtmp streams what is
proborly
why.
It heavily depends on the mp4 file used. moov atom needs to be at the
beginning of the file, for example. Get mp4box and read its doc, it will
help you prepare the file for streaming.
And besides that all videos are compiled for HTML5 streaming with the
following command line via ffmpeg. -movflags +faststart
So all metadata is at the start of the file all other mp4’s are fine
just
very large / very long mp4 files have this problem. webm ogg flv all
fine
and fast regardless of size.
So as you see the first media file to be delieverd for the media player
to
grab is the MP4.
If i switch and make the webm the first in line.
Now in my browser when i tell the media player to play it plays the webm
file first. And it loads instantly aswell as the webm is also a smaller
file
than mp4 and higher quality.
Well i dont get it all at once i just have to wait like 44 seconds
before
the first byte or bit of the download so i can play the media while the
rest
of it downloads.
It is such a unique issue. I never noticed it until now because when i
watch
the same length videos on youtube and places they stream it via rtmp
with
dash i recon. But when you delieve just a standard mp4 file for html5
streaming you encounter this problem.
I read that even cpu or ram could contribute to this but i find that
unlikely.
Posted at Nginx Forum:
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.