I am trying to stream with vlc usign this command:
-vvv Foreman_H264.mp4 --sout '#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}: rtp{mux=ts,dst=239.255.12.42,sdp=sap,name="TestStream"}'
this command works fine with a standard installation of vlc.
But now i have installed a short version of vlc with only this librarys:
ncurses
xcb
a52
ffmpeg
libxml
alsa
live
When i run the same command i get this error messages:
[00007f0194001318] stream_out_rtp stream out error: cannot create muxer
and
[00007f0194000c18] core stream output error: stream chain failed for `transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}: rtp{mux=ts,dst=239.255.12.42,sdp=sap,name="TestStream"}'
[00007f01a00009b8] core input error: cannot start stream output instance, aborting
It seems like I am still missing a library. But I don't know which one ? I thought the live library would do the job for rtp streaming.
Here the full log:
-vvv Foreman_H264.mp4 --sout '#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}: rtp{mux=ts,dst=239.255.12.42,sdp=sap,name="TestStream"}'
VLC media player 2.2.0 Weatherwax (revision 2.2.0-0-g1349ef2)
[0000000000f23118] core libvlc debug: VLC media player - 2.2.0 Weatherwax
[0000000000f23118] core libvlc debug: Copyright © 1996-2015 the VideoLAN team
[0000000000f23118] core libvlc debug: revision 2.2.0-0-g1349ef2
[0000000000f23118] core libvlc debug: configured with ./configure '--disable-mad' '--disable-libgcrypt' '--disable-lua'
[0000000000f23118] core libvlc debug: searching plug-in modules
[0000000000f23118] core libvlc debug: loading plugins cache file /usr/local/lib/vlc/plugins/plugins.dat
[0000000000f23118] core libvlc debug: recursively browsing `/usr/local/lib/vlc/plugins'
[0000000000f23118] core libvlc debug: saving plugins cache /usr/local/lib/vlc/plugins/plugins.dat
[0000000000f23118] core libvlc debug: plug-ins loaded: 326 modules
[0000000000f23118] core libvlc debug: opening config file (/home/stud/.config/vlc/vlcrc)
[0000000000f23118] core libvlc debug: translation test: code is "C"
[0000000000f23118] core libvlc debug: CPU has capabilities MMX MMXEXT SSE SSE2 SSE3 SSSE3 FPU
[0000000000fd8988] core input debug: Creating an input for 'Media Library'
[0000000000fd8988] core input debug: Input is a meta file: disabling unneeded options
[0000000000fd8988] core input debug: using timeshift granularity of 50 MiB, in path '/tmp'
[0000000000fd8988] core input debug: `file/xspf-open:///home/stud/.local/share/vlc/ml.xspf' gives access `file' demux `xspf-open' path `/home/stud/.local/share/vlc/ml.xspf'
[0000000000fd8988] core input debug: creating demux: access='file' demux='xspf-open' location='/home/stud/.local/share/vlc/ml.xspf' file='/home/stud/.local/share/vlc/ml.xspf'
[0000000000fde228] core demux debug: looking for access_demux module matching "file": 11 candidates
[0000000000fde228] core demux debug: no access_demux modules matched
[0000000000fd8988] core input debug: creating access 'file' location='/home/stud/.local/share/vlc/ml.xspf', path='/home/stud/.local/share/vlc/ml.xspf'
[0000000000fde228] core access debug: looking for access module matching "file": 17 candidates
[0000000000fde228] filesystem access debug: opening file `/home/stud/.local/share/vlc/ml.xspf'
[0000000000fde228] core access debug: using access module "filesystem"
[0000000000fbe048] core stream debug: Using stream method for AStream*
[0000000000fbe048] core stream debug: starting pre-buffering
[0000000000fbe048] core stream debug: received first data after 0 ms
[0000000000fbe048] core stream debug: pre-buffering done 296 bytes in 0s - 4379 KiB/s
[0000000000fbe2a8] core stream debug: looking for stream_filter module matching "any": 7 candidates
[0000000000fbe2a8] core stream debug: no stream_filter modules matched
[0000000000fbe2a8] core stream debug: looking for stream_filter module matching "record": 7 candidates
[0000000000fbe2a8] core stream debug: using stream_filter module "record"
[0000000000fd8988] core input debug: creating demux: access='file' demux='xspf-open' location='/home/stud/.local/share/vlc/ml.xspf' file='/home/stud/.local/share/vlc/ml.xspf'
[0000000000fc2078] core demux debug: looking for demux module matching "xspf-open": 56 candidates
[0000000000fc2078] xspf demux debug: using XSPF playlist reader
[0000000000fc2078] core demux debug: using demux module "playlist"
[0000000000fc22e8] core demux meta debug: looking for meta reader module matching "any": 0 candidates
[0000000000fc22e8] core demux meta debug: no meta reader modules
[0000000000fd8988] core input debug: `file/xspf-open:///home/stud/.local/share/vlc/ml.xspf' successfully opened
[0000000000fc2208] core xml reader debug: looking for xml reader module matching "any": 1 candidates
[0000000000fc2208] core xml reader debug: using xml reader module "xml"
[0000000000fc2078] xspf demux debug: parsed 0 tracks successfully
[0000000000fd8988] core input debug: EOF reached
[0000000000fc2078] core demux debug: removing module "playlist"
[0000000000fbe2a8] core stream debug: removing module "record"
[0000000000fde228] core access debug: removing module "filesystem"
[0000000000f36a38] core playlist debug: creating audio output
[0000000000fbe048] core audio output debug: looking for audio output module matching "any": 4 candidates
[0000000000fbe048] alsa audio output debug: Available ALSA PCM devices:
[0000000000fbe048] alsa audio output debug: Discard all samples (playback) or generate zero samples (capture) (null)
[0000000000fbe048] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH Default Audio Device (default:CARD=I82801AAICH)
[0000000000fbe048] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH Default Audio Device (sysdefault:CARD=I82801AAICH)
[0000000000fbe048] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH Front speakers (front:CARD=I82801AAICH,DEV=0)
[0000000000fbe048] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH 2.1 Surround output to Front and Subwoofer speakers (surround21:CARD=I82801AAICH,DEV=0)
[0000000000fbe048] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH 4.0 Surround output to Front and Rear speakers (surround40:CARD=I82801AAICH,DEV=0)
[0000000000fbe048] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH 4.1 Surround output to Front, Rear and Subwoofer speakers (surround41:CARD=I82801AAICH,DEV=0)
[0000000000fbe048] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH 5.0 Surround output to Front, Center and Rear speakers (surround50:CARD=I82801AAICH,DEV=0)
[0000000000fbe048] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH 5.1 Surround output to Front, Center, Rear and Subwoofer speakers (surround51:CARD=I82801AAICH,DEV=0)
[0000000000fbe048] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH IEC958 (S/PDIF) Digital Audio Output (iec958:CARD=I82801AAICH,DEV=0)
[0000000000fbe048] core audio output debug: using audio output module "alsa"
[0000000000f36a38] core playlist debug: keeping audio output
[0000000000f36a38] core playlist debug: adding item `Foreman_H264.mp4' ( file:///home/stud/Big_One/LB-KA_01/Foreman_H264.mp4 )
[000000000102ddf8] core interface debug: looking for interface module matching "hotkeys,none": 9 candidates
[00007f01a4000958] core input debug: Creating an input for 'Foreman_H264.mp4'
[000000000102ddf8] core interface debug: using interface module "hotkeys"
[0000000000fd8988] core interface debug: looking for interface module matching "globalhotkeys,none": 9 candidates
[0000000000fd8988] core interface debug: using interface module "xcb_hotkeys"
[0000000000f23118] core libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[0000000000fdf6e8] core interface debug: looking for interface module matching "any": 9 candidates
Remote control interface initialized. Type `help' for help.
[0000000000fdf6e8] core interface debug: using interface module "oldrc"
[0000000000f36a38] core playlist debug: processing request item: null, node: Playlist, skip: 0
[0000000000f36a38] core playlist debug: rebuilding array of current - root Playlist
[0000000000f36a38] core playlist debug: rebuild done - 1 items, index -1
[0000000000f36a38] core playlist debug: starting playback of the new playlist item
[0000000000f36a38] core playlist debug: resyncing on Foreman_H264.mp4
[0000000000f36a38] core playlist debug: Foreman_H264.mp4 is at 0
[0000000000f36a38] core playlist debug: creating new input thread
[00007f01a00009b8] core input debug: Creating an input for 'Foreman_H264.mp4'
[0000000000f36a38] core playlist debug: requesting art for Foreman_H264.mp4
[00007f0194000c18] core stream output debug: using sout chain=`transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}: rtp{mux=ts,dst=239.255.12.42,sdp=sap,name="TestStream"}'
[00007f0198000958] core art finder debug: looking for meta fetcher module matching "any": 0 candidates
[00007f0198000958] core art finder debug: no meta fetcher modules
[0000000000f23118] core libvlc debug: searching art for Foreman_H264.mp4
[00007f0198000958] core art finder debug: looking for art finder module matching "any": 1 candidates
[00007f0194000c18] core stream output debug: stream=`rtp'
[00007f0194001318] core stream out debug: looking for sout stream module matching "rtp": 20 candidates
[00007f0198000958] core art finder debug: no art finder modules matched
[00007f0198000958] core art finder debug: looking for meta fetcher module matching "any": 0 candidates
[00007f0198000958] core art finder debug: no meta fetcher modules
[0000000000f23118] core libvlc debug: searching art for Foreman_H264.mp4
[00007f0198000958] core art finder debug: looking for art finder module matching "any": 1 candidates
[00007f0198000958] core art finder debug: no art finder modules matched
[0000000000f23118] core libvlc debug: art not found for Foreman_H264.mp4
[00007f0194001318] core stream out debug: set config option: sout-rtp-mux to ts
[00007f0194001318] core stream out debug: set config option: sout-rtp-dst to 239.255.12.42
[00007f0194001318] core stream out debug: set config option: sout-rtp-sdp to sap
[00007f0194001318] core stream out debug: set config option: sout-rtp-name to TestStream
[00007f0194003bf8] core mux debug: looking for sout mux module matching "ts": 8 candidates
[00007f0194003bf8] core mux debug: no sout mux modules matched
[00007f0194001318] stream_out_rtp stream out error: cannot create muxer
[00007f0194001318] core stream out debug: no sout stream modules matched
[00007f0194001318] core stream out debug: destroying chain... (name=(null))
[00007f0194001318] core stream out debug: destroying chain done
[00007f0194000c18] core stream output error: stream chain failed for `transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}: rtp{mux=ts,dst=239.255.12.42,sdp=sap,name="TestStream"}'
[00007f01a00009b8] core input error: cannot start stream output instance, aborting
[0000000000f36a38] core playlist debug: finished input
[0000000000f36a38] core playlist debug: dead input
[0000000000f36a38] core playlist debug: changing item without a request (current 0/1)
[0000000000f36a38] core playlist debug: nothing to play
[0000000000f36a38] core playlist debug: meta ok for (null), need to fetch art
[00007f01a4001ce8] core art finder debug: looking for meta fetcher module matching "any": 0 candidates
[00007f01a4001ce8] core art finder debug: no meta fetcher modules
[0000000000f36a38] core playlist debug: searching art for Foreman_H264.mp4
[00007f01a4003da8] core art finder debug: looking for art finder module matching "any": 1 candidates
[00007f01a4003da8] core art finder debug: no art finder modules matched
[00007f01a4003628] core art finder debug: looking for meta fetcher module matching "any": 0 candidates
[00007f01a4003628] core art finder debug: no meta fetcher modules
[0000000000f36a38] core playlist debug: searching art for Foreman_H264.mp4
[00007f01a40017a8] core art finder debug: looking for art finder module matching "any": 1 candidates
[00007f01a40017a8] core art finder debug: no art finder modules matched
[0000000000f36a38] core playlist debug: art not found for Foreman_H264.mp4
^C[0000000000f23118] core libvlc debug: removing all interfaces
[0000000000f23118] core libvlc debug: exiting
[0000000000fdf6e8] core interface debug: removing module "oldrc"
[0000000000fd8988] core interface debug: removing module "xcb_hotkeys"
[000000000102ddf8] core interface debug: removing module "hotkeys"
[0000000000f36a38] core playlist debug: destroying
[0000000000f36a38] core playlist debug: deactivating the playlist
[0000000000fbe048] core audio output debug: removing module "alsa"
[0000000000fdf6e8] core playlist export debug: saving Media Library to file /home/stud/.local/share/vlc/ml.xspf.tmp14649
[0000000000fdf6e8] core playlist export debug: looking for playlist export module matching "export-xspf": 4 candidates
[0000000000fdf6e8] core playlist export debug: using playlist export module "export"
[0000000000fdf6e8] core playlist export debug: removing module "export"
stud#milbvm:~/Big_One/LB-KA_01$
I was missing the libdvbpsi. download
I installed it and recompiled vlc with --enable-dvbpsi
Related
I have trained a custom object detection, using transfer learning based on MobileNetV2. I converted the model to tflite format so that I can run it on my IOS device. However, when I run the model in xcode, I get an error.
2019-08-20 16:11:07.225613+0100 ObjectDetection[5692:1119136]
Initialized TensorFlow Lite runtime.
2019-08-20 16:11:07.280287+0100 ObjectDetection[5692:1119136] [MC]
System group container for
systemgroup.com.apple.configurationprofiles path is
/var/containers/Shared/SystemGroup/systemgroup.com.apple.configu
rationprofiles
2019-08-20 16:11:07.282075+0100 ObjectDetection[5692:1119136] [MC]
Reading from public effective user settings.
**Failed to invoke the interpreter with error: Provided data count
1080000 must match the required count 602112.
Failed to invoke the interpreter with error: Provided data count
1080000 must match the required count 602112.**
I want to display a stream, and monitor the video stats of the displayed stream while recording it using libvlc. When I use sout + duplicate to record the stream while displaying it, I can only get the demux_bitrate stat from the displayed stream using libvlc_media_get_stats function. I am looking to get decoded_video, displayed_pictures, etc as well.
I've tried using the duplicate module to try to make this happen but I can't seem to make this work - am not sure if what I want to do is supported. Code below is tweaked from https://wiki.videolan.org/Documentation:Modules/display/ example for transcoding a stream while displaying the original version.
:sout=#duplicate{dst='transcode{vcodec=h264}:std{access=file,mux=ts,dst=c:\junk\test.mp4}',dst=display}
The stream displays, the file is generated, but the only valid stat is demux_bitrate which seems like the stat that would be accessible from the non-display stream instead of the displayed version.
Display and save with Transcoding
:sout=#duplicate{dst=display,dst="transcode{vcodec=h264}:standard{access=file,mux=mp4,dst=c:\junk\test.mp4}"}
Display and save without Transcoding
:sout=#duplicate{dst=display,dst=standard{access=file,mux=mp4,dst=c:\junk\test.mp4}}
I have a live RTSP stream that i have managed to transcode to HLS via VLC. Now it works perfect on Android and on desktop browsers (via flash).
But not on Apple (i can test it on iPad and desktop Safari on my virtual machine). I can see the player but when i press the 'play' button all i see is a black rectangle inside the player. On desktop Safari there is also a text 'Loading...' near the play/pause button and nothing else happens.
My HTML:
<video id="player" controls style="width:100%; height:100%">
<source src="http://178.79.164.114/playlist.m3u8" type="application/x-mpegURL">
</video>
The command for vlc:
vlc -I dummy rtsp://<stream-url> --sout '#transcode{width=320,height=240,fps=25,vcodec=h264,vb=256,acodec=none,venc=x264{aud,profile=baseline,level=30,keyint=30,bframes=0,ref=1,nocabac}}:std{access=livehttp{seglen=10,delsegs=true,numsegs=5,index=/path/to/server/directory/playlist.m3u8,index-url=http://178.79.164.114/seg-########.ts},mux=ts{use-key-frames},dst=/path/to/server/directory/seg-########.ts}'
And an example of the playlist file:
#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-VERSION:3
#EXT-X-ALLOW-CACHE:NO
#EXT-X-MEDIA-SEQUENCE:179
#EXTINF:9.60,
http://178.79.164.114/seg-00000179.ts
#EXTINF:9.60,
http://178.79.164.114/seg-00000180.ts
#EXTINF:9.60,
http://178.79.164.114/seg-00000181.ts
#EXTINF:9.61,
http://178.79.164.114/seg-00000182.ts
#EXTINF:9.59,
http://178.79.164.114/seg-00000183.ts
And here is the strange output of ffprobe http://178.79.164.114/playlist.m3u8 (why there are these N/A and the variant_bitrate is 0?). Maybe it can help:
Input #0, hls,applehttp, from 'http://178.79.164.114/playlist.m3u8':
Duration: N/A, start: 3995.330722, bitrate: N/A
Program 0
Metadata:
variant_bitrate : 0
Stream #0:0: Video: h264 (Constrained Baseline) ([27][0][0][0] / 0x001B), yuv420p, 320x240 [SAR 11:12 DAR 11:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
I have also configured correct MIME types for .m3u8 and .ts files and spent a day searching and trying different options for the transcode command: width, height, bitrate, fps, different profiles and levels... - nothing works. But if i try some examples from apple (http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8) - all is fine, though it's not a live stream.
If anyone has any ideas or has a possibility to test my stream with the mediastreamvalidator - please help.
UPDATE
Now i'm experimenting with variant playlist but it changes nothing.
The player might expect muxed video and audio so add a silent audio track.
The Apple HLS documentation says:
The media segment files are normally produced by the stream segmenter, based on input from the encoder, and consist of a series of .ts files containing segments of an MPEG-2 Transport Stream carrying H.264 video and AAC, MP3, or AC-3 audio
Support for audio-only streams is mentioned in Technical Note TN2224 and the 7th revision of the protocol introduced support for alternate renditions (unmuxed streams) but this is done with EXT-X-MEDIA tags in a master playlist controlling the playback (yours is a media playlist).
An HLS (m3u8) file references mpeg-ts files. During its playback in iOS' AVPlayer, how can i determine the currently playing mpeg-ts URI?
If your looking for a reference to the URI of the currently downloading TS, it's not available. You can get the URI of the stream for the current bit-rate by looking at the current AVPlayerItem's -accessLog.
E.g.:
[[[player currentItem] accessLog] events]
It's an NSArray of AVPlayerItemAccessLogEvent's.
But it's not going to give you the URI of the TS per se. You may just have to calculate the current TS by where the playhead is currently at in relation to the duration as well as the segment size.
Ok, I have been trying to wrap my head around this http live streaming. I just do not understand it and yes I have read all the apple docs and watched the wwdc videos, but still super confused, so please help a wanna be programer out!!!
The code you write goes on the server? not in xcode?
If I am right how do i set this up?
Do I need to set up something special on my server? like php or something?
How do use the tools that are supplied by Apple.. segmenter and such?
Please help me,
Thanks
HTTP Live Streaming
HTTP Live Streaming is a streaming standard proposed by Apple. See the latest draft standard.
Files involved are
.m4a for audio (if you want a stream of audio only).
.ts for video. This is a MPEG-2 transport, usually with a h.264/AAC payload. It contains 10 seconds of video and it is created by splitting your original video file, or by converting live video.
.m3u8 for the playlist. This is a UTF-8 version of the WinAmp format.
Even when it's called live streaming, usually there is a delay of one minute or so during which the video is converted, the ts and m3u8 files written, and your client refresh the m3u8 file.
All these files are static files on your server. But in live events, more .ts files are added, and the m3u8 file is updated.
Since you tagged this question iOS it is relevant to mention related App Store rules:
You can only use progressive download for videos smaller than 10 minutes or 5 MB every 5 minutes. Otherwise you must use HTTP Live Streaming.
If you use HTTP Live Streaming you must provide at least one stream at 64 Kbps or lower bandwidth (the low-bandwidth stream may be audio-only or audio with a still image).
Example
Get the streaming tools
To download the HTTP Live Streaming Tools do this:
Get a Mac or iPhone developer account.
Go to https://developer.apple.com and search for "HTTP Live Streaming Tools", or look around at https://developer.apple.com/streaming/.
Command line tools installed:
/usr/bin/mediastreamsegmenter
/usr/bin/mediafilesegmenter
/usr/bin/variantplaylistcreator
/usr/bin/mediastreamvalidator
/usr/bin/id3taggenerator
Descriptions from the man page:
Media Stream Segmenter: Create segments from MPEG-2 Transport streams for HTTP Live Streaming.
Media File Segmenter: Create segments for HTTP Live Streaming from media files.
Variant Playlist Creator: Create playlist for stream switching from HTTP Live streaming segments created by mediafilesegmenter.
Media Stream Validator: Validates HTTP Live Streaming streams and servers.
ID3 Tag Generator: Create ID3 tags.
Create the video
Install Macports, go to the terminal and sudo port install ffmpeg. Then convert the video to transport stream (.ts) using this FFMpeg script:
# bitrate, width, and height, you may want to change this
BR=512k
WIDTH=432
HEIGHT=240
input=${1}
# strip off the file extension
output=$(echo ${input} | sed 's/\..*//' )
# works for most videos
ffmpeg -y -i ${input} -f mpegts -acodec libmp3lame -ar 48000 -ab 64k -s ${WIDTH}x${HEIGHT} -vcodec libx264 -b ${BR} -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 ${BR} -bufsize ${BR} -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 30 -qmax 51 -qdiff 4 -level 30 -aspect ${WIDTH}:${HEIGHT} -g 30 -async 2 ${output}-iphone.ts
This will generate one .ts file. Now we need to split the files in segments and create a playlist containing all those files. We can use Apple's mediafilesegmenter for this:
mediafilesegmenter -t 10 myvideo-iphone.ts
This will generate one .ts file for each 10 seconds of the video plus a .m3u8 file pointing to all of them.
Setup a web server
To play a .m3u8 on iOS we point to the file with mobile safari.
Of course, first we need to put them on a web server. For Safari (or other player) to recognize the ts files, we need to add its MIME types. In Apache:
AddType application/x-mpegURL m3u8
AddType video/MP2T ts
In lighttpd:
mimetype.assign = ( ".m3u8" => "application/x-mpegURL", ".ts" => "video/MP2T" )
To link this from a web page:
<html><head>
<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
</head><body>
<video width="320" height="240" src="stream.m3u8" />
</body></html>
To detect the device orientation see Detect and Set the iPhone & iPad's Viewport Orientation Using JavaScript, CSS and Meta Tags.
More stuff you can do is create different bitrate versions of the video, embed metadata to read it while playing as notifications, and of course have fun programming with the MoviePlayerController and AVPlayer.
This might help in swift:
import UIKit
import MediaPlayer
class ViewController: UIViewController {
var streamPlayer : MPMoviePlayerController = MPMoviePlayerController(contentURL: NSURL(string:"http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8"))
override func viewDidLoad() {
super.viewDidLoad()
streamPlayer.view.frame = self.view.bounds
self.view.addSubview(streamPlayer.view)
streamPlayer.fullscreen = true
// Play the movie!
streamPlayer.play()
}
}
MPMoviePlayerController is deprecated from iOS 9 onwards. We can use AVPlayerViewController() or AVPlayer for the purpose. Have a look:
import AVKit
import AVFoundation
import UIKit
AVPlayerViewController :
override func viewDidAppear(animated: Bool){
let videoURL = NSURL(string: "https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4")
let player = AVPlayer(URL: videoURL!)
let playerViewController = AVPlayerViewController()
playerViewController.player = player
self.presentViewController(playerViewController, animated: true) {
playerViewController.player!.play()
}
}
AVPlayer :
override func viewDidAppear(animated: Bool){
let videoURL = NSURL(string: "https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4")
let player = AVPlayer(URL: videoURL!)
let playerLayer = AVPlayerLayer(player: player)
playerLayer.frame = self.view.bounds
self.view.layer.addSublayer(playerLayer)
player.play()
}
Another explanation from Cloudinary http://cloudinary.com/documentation/video_manipulation_and_delivery#http_live_streaming_hls
HTTP Live Streaming (also known as HLS) is an HTTP-based media streaming communications protocol that provides mechanisms that are scalable and adaptable to different networks. HLS works by breaking down a video file into a sequence of small HTTP-based file downloads, with each download loading one short chunk of a video file.
As the video stream is played, the client player can select from a number of different alternate video streams containing the same material encoded at a variety of data rates, allowing the streaming session to adapt to the available data rate with high quality playback on networks with high bandwidth and low quality playback on networks where the bandwidth is reduced.
At the start of the streaming session, the client software downloads a master M3U8 playlist file containing the metadata for the various sub-streams which are available. The client software then decides what to download from the media files available, based on predefined factors such as device type, resolution, data rate, size, etc.