Stream drops to audio after a short time (1 Viewer)

j1nx

Portal Pro
July 16, 2005
233
10
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="&quot;C:/Program Files/iPiMP/Utilities/ffmpeg\ffmpeg.exe&quot;" args="-i - -threads 0 -re -vcodec libx264 -fpre &quot;C:/Program Files/iPiMP/Utilities/ffmpeg/ffpresets/libx264-iPiMP.ffpreset&quot; -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??

UPDATE::

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.

FOUND THIS

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.

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.

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.
 

cheezey

Community Plugin Dev
August 26, 2004
1,560
312
55
West Yorks, UK
Home Country
United Kingdom United Kingdom
  • Thread starter
  • Moderator
  • #13
The segmenter was going to be the original solution, however it was very tricky getting a segmenter compiled on windows, it also produced only Apple streaming format, no flash or silverlight. SmoothStreaming is a much more flexible solution providing a single process to produce adaptive streaming to multiple client platforms, so i'll be putting the effort into getting that working.
 

griffindodd

Portal Pro
March 28, 2009
72
2
this is interesting...

i just tried out PlayOn from my server to my iPhone 4 running iOS 4.1 and what do you know, when the streaming starts to the phone and has to rebuffer the stream drops to audio only. I think this is an issue the iPhone player Apple HTTP Live Streaming client.

Others are experiencing the same issues on all sorts of different web streaming applications...

iPhone Streaming Video stopped after few seconds : The Official Microsoft IIS Site

I don't know if any of these changes are relevant to what you are doing here, but apparently they helped someone in that thread experiecing the same problems using smoothstream.isml ...


- Turned off Client Caching and Server Caching

- Turned off iOS 3.0 Compatibility

- Changed the default 3000 to 5000 kbps for max bit rate in Mobile tab.

- Changed Window Length to 120 minutes instead of the entire event.

All of these settings are in some way related to the .isml but I have no idea what where or how.
 

King-S

MP Donator
  • Premium Supporter
  • August 6, 2008
    165
    2
    Near Frankfurt
    Home Country
    Germany Germany
    AW: Stream drops to audio after a short time

    Hello,

    I have the same problem and was looking for the solution all the day. I've recognized something very interesting. I sniffed the packets with a packet sniffer (of course ;)) and saw, that a completly new connection is created, without video - just like a new conversion file.

    At first, the video and sound is transfered to the streaming device. My packet sniffer says: Video 100k, Audio 32k. The size of all theses packets is about 400kb. When iPhone stops, also the file in the packet sniffer stops and a new one is created. Then, the iPhone plays the audio stream. Technically, a new file/packet is being started and transfered. The packet sniffers says: No Video, Audio 32k. After this one stop the streaming will do without any stuttering, buffering and so on.

    So I think, in this gap a new streamingfile is created. I can't proof this - I only can say, what the packet sniffer said.

    I also use Air Video. I have absolutely no probles with this - even with streaming over 3G.

    I hope this helps a little. For logs / questions a.s.o, please reply.

    (And sorry for my bad english)
     

    cheezey

    Community Plugin Dev
    August 26, 2004
    1,560
    312
    55
    West Yorks, UK
    Home Country
    United Kingdom United Kingdom
    • Thread starter
    • Moderator
    • #20
    Here's an update to try to fix this dropped video stream issue.

    1. Download the updated FFMpeg here.
    2. Download the updated smooth streaming Apache module here.
    3. Stop the iPiMPWeb service (at a command prompt use NET STOP iPiMPWeb)
    4. Rename the folder C:\Program Files\iPiMP\Utilities\FFMpeg to C:\Program Files\iPiMP\Utilities\FFMpeg.old
    5. Rename the file C:\Program Files\iPiMP\Apache\modules\mod_smooth_streaming.so to C:\Program Files\iPiMP\Apache\modules\mod_smooth_streaming.so.old
    6. Backup C:\Program Files\iPiMP\Aspx\config.xml somewhere safe
    7. Unzip the updated FFMpeg into C:\Program Files\iPiMP\Utilities (check you end up with C:\Program Files\iPiMP\Utilities\FFMpeg\FFMpeg.exe)
    8. Unzip the updated smooth streaming Apache module into C:\Program Files\iPiMP\Apache\modules
    9. Start the iPiMPWeb service (at a command prompt use NET START iPiMPWeb)
    10. Edit (DONT COPY & PASTE) the ffmpeg and smoothstreaming module parameters in C:\Program Files\iPiMP\Aspx\config.xml and change line 3 from
    <transcoder name="LiveTV" usetranscoding="1" filename="&quot;C:/Program Files/iPiMP/Utilities/ffmpeg\ffmpeg.exe&quot;" args="-i - -threads 0 -re -vcodec libx264 -fpre &quot;C:/Program Files/iPiMP/Utilities/ffmpeg/ffpresets/libx264-iPiMP.ffpreset&quot; -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:80/SmoothStream.isml/Streams(SmoothStream)?dvr_window_length=15" inputmethod="2" outputmethod="4" />

    to

    <transcoder name="LiveTV" usetranscoding="1" filename="&quot;C:/Program Files/iPiMP/Utilities/ffmpeg\ffmpeg.exe&quot;" args="-i - -threads 0 -re -vcodec libx264 -fpre &quot;C:/Program Files/iPiMP/Utilities/ffmpeg/ffpresets/libx264-veryfast.ffpreset&quot; -g 100 -keyint_min 50 -b 256k -s 480x272 -aspect 480:272 -acodec libfaac -ac 2 -ab 64k -ar 44100 -ac 2 -async 2 -f ism http://127.0.0.1:80/SmoothStream.isml/Streams(SmoothStream)" inputmethod="2" outputmethod="4" />
    In summary, the parameter changes are:
    1. Use libx264-veryfast.preset instead of libx264-iPiMP.preset
    2. Add -g 100 -keyint_min 50
    3. Change audio rate from 48000 to 44100
    4. Remove ?dvr_window_length=15

    Report back on your findings.

    :D
     

    Users who are viewing this thread

    Top Bottom