Reputation: 18729
In my ios app I am trying to play videos using http live streaming. The playing goes well until I decide to use the scrubber and skip to some point that hasn't buffered yet. From that moment the audio goes on but the videos goes black.
I've converted my .MP4 videos with the following command:
avconv -y -i video.mp4 -f mpegts -acodec libmp3lame -ar 48000 -ab 64k -s 640x480 -vcodec libx264 -b 64k -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 7 -trellis 0 -refs 0 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 200k -maxrate 64k -bufsize 64k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 30 -qmax 51 -qdiff 4 -level 30 -aspect 640:480 -g 30 -async 2 sample_64.ts
I did this with multiple bitrates (64, 150, 240, 440 and 640) and created one .m3u8
that contains the different streams. After converting I used the mediafilesegmenter
to split the video in segments of each 10 seconds.
After scrubbing the following appears in the output window:
2013-03-08 17:30:21.827 Geschiedenis Trainer[88129:19a03] [MPAVController] Autoplay: Disabling autoplay for pause
2013-03-08 17:30:21.827 Geschiedenis Trainer[88129:19a03] [MPAVController] Autoplay: Disabling autoplay
2013-03-08 17:30:21.977 Geschiedenis Trainer[88129:19a03] [MPAVController] Autoplay: _streamUnlikelyToKeepUp: 1 -> 0
2013-03-08 17:30:21.978 Geschiedenis Trainer[88129:19a03] [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 1, on player: 0)
2013-03-08 17:30:21.978 Geschiedenis Trainer[88129:19a03] [MPAVController] Autoplay: _streamRanDry: 0 -> 1
2013-03-08 17:30:21.980 Geschiedenis Trainer[88129:19a03] [MPAVController] Autoplay: Took background task assertion (32) for playback stall
2013-03-08 17:30:21.981 Geschiedenis Trainer[88129:19a03] [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 1, on player: 0)
2013-03-08 17:30:22.634 Geschiedenis Trainer[88129:19a03] [MPAVController] Autoplay: _streamUnlikelyToKeepUp: 0 -> 0
2013-03-08 17:30:22.634 Geschiedenis Trainer[88129:19a03] [MPAVController] Autoplay: _streamRanDry: 0 -> 1
2013-03-08 17:30:22.667 Geschiedenis Trainer[88129:19a03] [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 1, on player: 0)
2013-03-08 17:30:22.769 Geschiedenis Trainer[88129:19a03] [MPAVController] Autoplay: Ending background task assertion (32) for playback stall
The code for my videoplayer:
self.streamPlayer = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
[self.view addSubview:self.streamPlayer.view];
[self.streamPlayer setFullscreen:YES animated:YES];
This problem does not occur when skipping to a point that has already been buffered.
Upvotes: 2
Views: 1577
Reputation: 18729
The problem was in the conversion of my videos. I was using an outdated version of avconv
/ffmpeg
. I updated ffmpeg to the latest version (1.1) and that solved the problem.
After converting the video I used apple's mediafilesegmenter
to split the video in 10 second segments. Before updating ffmpeg it generated an error: segment does not contain sync frame
for each segment. After updating ffmpeg this error disappeared and so did the streaming problems.
Upvotes: 1