Reputation: 11
Basically, I want to stream and play a MMS video with iOS SDK. I can stream some videos with MPMovieplayer
but not MMS or RSTP.
I researched this, but I couldn't find a clear solution. Can anybody help me?
I tried VLC Mobile: http://wiki.videolan.org/MobileVLC Dropcam: https://github.com/dropcam/dropcam_for_iphone
But I am unable to use these options.
Upvotes: 1
Views: 2025
Reputation: 161
You should use ffmpeg library, as this library can connect any streaming server (supporting rtsp, mms, tcp, udp ,rtmp ...) and then draw pictures to the screen.. (for drawing you can use opengles or uiimage also works)
First of all, use avformat_open_input to connect to your ip address then use avcodec_find_decoder & avcodec_open2 to find codecs and to open them (you should call them for both audio & video)
Then, in a while loop read packets from server by using av_read_frame method When you get frame, if it is audio then sent it to AudioUnit or AudioQueue, if it is video, then convert it from yuv to rgb format by using sws_scale method and draw the picture to the screen.
That's all.
look at this wrapper also (http://www.videostreamsdk.com), it's written on ffmpeg library and supports iOS
Upvotes: 1