how to save stream as mp4 and play it? - streaming

I need to play a live stream of my computer screen with a play that knows only to play MP4 files
any ideas for how to save the stream to MP4 file and play is in the player ?

VLC is the only tool you need to capture your screen and save it to MP4 file. Then you can play it wherever you want.
Everything you want to do is well described here: http://www.howtogeek.com/120202/how-to-record-your-desktop-to-a-file-or-stream-it-over-the-internet-with-vlc/
You can also directly capture your screen and immediately stream it via multi/unicast stream.
Works great both on Nix and Win platforms.

Related

How to play video while it is downloading using AVPro video in unity3D?

I want to play the video simultaneously while it is downloading via unitywebrequest. Will AVPro video support this? If so please provide me some guidance, as i am new to unity and avpro video. I can able to play the video which is downloaded fully through FullscreenVideo.prefab in AVPro demo. Any help will be much appreciated.
There are two main options you could use for displaying the video while it is still downloading.
Through livestream
You can stream a video to AVPro video using the "absolute path or URL" option on the media player component, then linking this to a stream in rtsp, MPEG-DASH, HLS, or HTTP progressive streaming format. Depending on what platforms you will be targeting some of these options will work better than others
A table of which file format supports what platform can be found in the AVProVideo Usermanual that is included with AVProVideo from page 12 and onwards.
If you want to use streaming you also need to set the "internet access" option to "required" in the player settings, as a video cannot stream without internet access.
A video that is being streamed will automatically start/resume playing when enough video is buffered.
This does however require a constant internet connection which may not be ideal if you're targeting mobile devices, or unnecessary if you're planning to play videos in a loop.
HLS m3u8
HTTP Live Streaming (HLS) works by cutting the overall stream into shorter, manageable hunks of data. These chunks will then get downloaded in sequence regardless of how long the stream is. m3u8 is a file format that works with playlists that keeps information on the location of multiple media files instead of an entire video, this can then be fed into a HLS player that will play the small media files in sequence as dictated in the m3u8 file.
using this method is usefull if you're planning to play smaller videos on repeat as the user will only have to download each chunk of the video once, which you can then store for later use.
You can also make these chunks of video as long or short as you want, and set a buffer of how many chunks you want to have pre-loaded. if for example you set the chunk size to 5 seconds, with a buffer of 5 videos the only loading time you'll have is when loading the first 25 seconds of the video. once these first 5 chunks are loaded it will start playing the video and load the rest of the chunks in the background, without interrupting the video (given your internet speed can handle it)
a con to this would be that you have to convert all your videos to m3u8 yourself. a tool such as FFMPEG can help with this though.
references
HLS
m3u8
AVPro documentation

iPhone - IMA WAV ADPCM audio stream for iOS

I am trying to write an app for a school project that will play a video stream of the lab. They use Foscam cameras, and from what I understand they only stream audio in FFMPEG and VLC (a wrapper of FFMPEG and others, correct?). I can play the video stream in a UIWebView just fine, but I can't figure out how to get audio to work. I have read a bunch of post on here about the different audio stream options, but none support this format. I have also looked into VLCKit, but that seems to only work in OS X, not iOS.
Is there a Framework, or Kit that can stream IMA WAV ADPCM audio from a VLC/FFMPEG file, or does someone know of a better way to get audio from a Foscam?
EDIT - I know more about the stream and I have tried a few things. I tried AVPlayer, but discovered Audio FIle Stream and Audio Queue Services but can't find a good tutorial.
I also found THIS site, and tried the project with my stream and it did not work.

playing downloaded audio video in iphone

Hi seen many tutorial but couldn't find the right workable answer. I need to play audio and video file from my webservice, for this I want to download the file and play it in the app, seen tutorial for avPlayer nothing workable. Please provide link or guide how to do this.
Use MPMoviePlayer, as this can open network streams and despite the name works with audio. The only thing is this pops up the modal player with controls.
First Download the network file using NSURLConnection and store it locally, then use AVAudioPlayer to play the local file.

Play FLV stored on Red5 server

so I have a flash video recorder that uses Red5 media server. After recording the video, it saves an FLV file to the Red5 RTMP server. My question is, if I wanted to use just a regular free FLV player (JWPlayer) would I just use the regular player and set the video source as something like rtmp://domain.com/recorder/streams/test.flv ? Or would I set the player to use single rtmp stream with this player builder? http://www.longtailvideo.com/support/jw-player-setup-wizard?example=204 I dont know if that requires some actual streaming app in rtmp. Thanks.
I think there is no "OR" in what you could do. It results in the same thing.
If you want to stream the FLV from the server you specify an URL that starts with "rtmp".
I guess the link will just exactly do that. However you can of course also configure your FLV player manually.
I dont know if that requires some actual streaming app in rtmp. Thanks.
=> Usually FLV players can play a rtmp stream. But of course you need a Red5 server and the FLV must be available in the streams directory of the webapp. Similar to:
rtmp://domain.com/recorder/streams/test.flv
Usually you could specify the URL also with: rtmp://domain.com:1935/recorder/test[.flv]
recorder is the webapp.
test[.flv] is the file you want to stream (It might be that "test" is enough, without the .flv suffix)
no need to put "streams" into the URL to stream the video. "streams" in the default folder for the video in Red5, comparable to your FLV_VIDEO_ROOT directory of this webapp "recorder".

Streaming "proxy" converting video formats

This is related to my another question
Here I'd like to ask if it is in theory (according to video file formats and codecs, etc) possible to have such scenario:
1) Client on iPhone has a reference to video in flv format. It sends http request to converting "proxy" like http://convproxy.com?source=url_of_original_video.flv by just clicking such link in Safari
2) Converting proxy starts downloading that flv file and converting it to mp4 (which iphone understands) on the fly, returning converted portion as http response, so iPhone can immediately start playing it, before entire flv is downloaded and converted.
I was playing with ffmpeg trying to do such thing, and it indeed converts flv and produces mp4 file, however that mp4 file can not be played until convertion is finished or ffmpeg is stopped. If I just kill ffmpeg process the mp4 file can not be played. If I let it finish or press ctrl-c to stop it, the part that was downloaded and converted can be played. Seems like ffmpeg does some job after it receives stop signal. Is that a necessary part of mp4 format or it can be done differently? I see that iPhone can stream video, by starting playing before the entire file is downloaded to it, so in general it seems like possible scenario for me.
I short words, I can convert flv file to mp4 file, and the question is if I can convert flv stream to mp4 stream.
According to wikipedia, the MP4 container format requires a separate "hint track" to enable streaming. I assume ffmpeg writes this at the end of the conversion. If the iPhone OS requires this track to stream, I don't see a way to stream live video outside of using a different format and having a custom decoder on the iPhone side similar to how the Orb client for iPhone does it.