Obtain stream format from AVPlayer Swift - swift

May someone of you know if it's possible to obtain the stream format from the current playing item through AVPlayer? I would need to observe if it's: mpeg4, HLS, flv or whatever.
Thank you so much!

Depends on what ending does the player video link has. The correct way is to check the manifest which you can find with a proxy. But for the easiest way if your link is .m3u8 it's HLS.
Now to get the codec that the video has you need to get the manifest from the response of the .m3u8.

Related

Saving m3u8 video to disk in swift cocoa

I am trying to save any m3u8 stream playlist as video to disk as 1 complete video file, similar to vlc. I can create an AVAsset and play it in an AVPlayer fine, however the m3u8 links i have tried all return false from asset.isExportable so using AVAssetExportSession does not work. I thought it might be possible opening the link as an InputStream and then writing it to an OutputStream but was lost on how to do this. Is this a viable option or will it only return the actual m3u8 file instead of the .ts video links? Any guidance in the right direction would be appreciated. I am fine doing the research on how to use the different classes, i'm just kinda lost on where to go from here.
Thank you,
Phil
Building a single video from all the streams in a m3u8 playlist may not actually give you what you want, depending on the m3u8 file.
This is because m3u8 playlists can contain multiple bit rate versions for a single video - so if you added them all together you would get the same video with different quality levels (bit rates) one after another.
Its also worth noting that some videos streams will be encrypted, in fact most high value streams such as Netflix etc will be, so downloading them will not allow you to play them back unless you do it as part of the providers own 'download and go' service.
Finally, some services may make it hard for you to access the streams by requiring some form of authentication in parallel with the video stream URL.
Assuming all the above is fine or does not apply in your case, then the video files themselves can be downloaded as files using a HTTP downloading function. Good examples of these exist such as: https://stackoverflow.com/a/35510812/334402

Live Streaming Video in iPhone

I am new to iPhone Development. I need to capture video. While I'm capturing video it display on server too. Something like live streaming.
Anyone have idea from where I should have to start for this functionality?
Thanks in Advance.
Your question seems similar to this
Xcode ios: Streaming of video file while recording and removed redundant personal statements
First Half Solution
Using AVFoundation you can get video Buffer/frames while recording.
Second Half
But for uploading i didn't find any solution
There is Input Stream option there in iOS APIs but it need some file path. but as video is not recorded we didn't have any path.
Edit 1
Here is Best Example for AVFoundation provided by Apple, you can start with
I recommend you to use wowza wowza.com/https://www.wowza.com, it has all the features, from live stream, video on demand and etc.

video playing sample on iPhone using libffmpeg

can someone please provide a reference or an example on usage of libffmpeg library for playing video files not supported by apple.
Let consider mkv file.
I suppose the library decodes and passes the raw media data to AVFoundation objects to play it on device. Am I right ?
Another useful example is ffmpeg4iphone project it does have Player class which does actually playing the video and audio channel
One alternative to look at is kxmovie project on GitHub.

How to record audio stream from internet radio resourse?

In my application I play internet audio/radio stream with AVPlayer. I want to save and playing audio. Could you give me a right way to resolve this problem (with example, please).
check the link http://blog.evandavey.com/2010/04/how-to-iphone-sdk-play-and-record-audio-concurrently.html hope it will help .

IPhone: Video API: Live video streaming modify

I have a question about video stream processing. Is it possible to get access and modify real time video stream during recording (f.e. I want to add some text to video)? I can do this as a preview by getting separate frames, but I'm looking for tool which will allow me to store video with my text in video frames.
Probably there is already some libraries/tools available (but I haven't found any yet).
Try GPUIMAGE library. It can help you.
You should check AVCam sample code by apple. That might be a starting point.