That the playback starts an X amount of second before the END of the buffer is handled by the SmoothStreaming module. "?dvr_window_length=15" <- This variable is handling that. It is set to 15 seconds, so it is still strange that it start at 5 seconds before the end.Interesting...
I changed the bandwidth variable for video (which I assume is the -b flag) and it didn't seem to make any difference. I turned it all the way down to 10k but the stream still looked very high quality on the iPhone.
Here's the variable and profile I altered...
<transcoder name="LiveTV" usetranscoding="1" filename=""C:/Program Files/iPiMP/Utilities/ffmpeg\ffmpeg.exe"" args="-i - -threads 0 -re -vcodec libx264 -fpre "C:/Program Files/iPiMP/Utilities/ffmpeg/ffpresets/libx264-iPiMP.ffpreset" -b 256k -s 480x272 -aspect 480:272 -acodec libfaac -ac 2 -ab 64k -ar 48000 -ac 2 -async 2 -f ism http://127.0.0.1:1972/SmoothStream.isml/Streams(SmoothStream)?dvr_window_length=15" inputmethod="2" outputmethod="4" />
Could it be that FFMpeg is ignoring the conditions set in this config??
Ok I fixed the bitrate issue by specifying the buffer size and managing the min/max bitrates...
-b 256k -bufsize 100000K -minrate 128K -maxrate 312K
So at least it's not ignoring the bitrate now.
However this doesn't solve the dropout problem.
I noticed that if I left the video to buffer for a few minutes before playing it still drops out after a few seconds, it seems that playback starts 5 seconds from the end of the buffer rather than starting from the beginning, so even letting the stream buffer for 2 minutes, when you press play it starts playback from 1:55 and then of course runs out of buffer quickly.
I noticed it does the same on Flash streaming in a web browser and the iPhone playback, so it's not just isolated to the iPhone as such.
Not sure how to stop this.
About the bitrate. I already mentioned somewhere, the H264 is actually a variable bitrate codec, hence most of the parameters set in the preset file are about the "margin" of quality. (while testing, the output of ffmpeg is written in the apache log, for fun start changing the "Q_min" parameter)
Anyway, the "min","max" and "buffer" will kind of forces it within a window, but still it does not comply with the "-b" parameter.
I am in Qatar on a offshore job at the moment. Still trying to write down my observations from the last couple of weeks, explaining most of the parameters and all. I am lacking some proper amount of time at the moment.