qt faststart and ffmpeg to generate a live mp4 file [duplicate] - linux

This question already has answers here:
Live video streaming using progressive download (and not RTMP) in Flash
(2 answers)
Closed 9 years ago.
I am using ffmpeg to create an mp4 file on my server. I am also trying to use qt fast start to be able to move the moov atom to the front so it will stream. I have searched all over the internet with no luck. Is it possible to put my video/audio in a mp4 buffer type file and then be able to play it while ffmpeg is still dumping video and audio data into the stream? the point is I am trying to stream from a camera and Android is horrid... I know both ios and android support mp4 so I was trying to figure a way I can make my rtsp Mp4.
main point of the story: I want to continuously feed my mp4 container my camera feed and still be able to playback the file os my clients can watch.
any help appreciated thank you.

You can publish a live stream and when the stream has ended you publish the progressive download.
In FFmpeg, to stream live and save a duplicate of that stream into a file at the same time without encoding twice you can use the Tee pseudo-mixer. Something like this:
ffmpeg \
-i <input-stream> \
-f tee "[movflags=+faststart]output.mp4|http://<ffserver>/<feed_name>"
Update: You might try to directly stream a fragmented mp4.
Update 2:
Create a fragmented mp4:
ffmpeg -i input -frag_duration 1000 stream.mp4
Normally, when serving a file using a web server it will want to know the file size, so to serve the file without knowing it's size, you need to configure your web server to do Chunked Transfer Encoding.

Related

Stream AVI video like Plex?

I've been looking for a solution to stream .avi video files for a while now and I can't find anything.
I found the Plex tool which allows to have a web interface of the media library. And precisely Plex allows the playback of .avi video on its web interface!
I saw that it uses blob:// so it's a file that is segmented I guess?
I was wondering if you have any idea how they do this magic?

How to stream audio mp3 file on web

Approx we all know about gaana.com, and saavn.com, that website stream audio mp3 files to client side but does't allow to users to grab the audio files, actually we want to know what technology he used to stream the audio mp3 files.
is he using streaming server or or something else ?
Can you describe the technology he is using in steaming the audio files.
Actually we are also creating a web app where audio files will be streammed in client side and we also don't want to allow users to download our mp3 files like gaana.com or saavn.com.
and we are also curious about if we want to stream our audio mp3 files in three different quality the what should i do. Should we convert all the mp3 files in all the three different quality and upload to the server or is any another solution exist for this purpose.
If you want to code your own streaming server then you can use this link
https://pypi.python.org/pypi/DeeFuzzer/ it's a python based streaming server, or you can also use ffmpeg or even VLC

Encoding wav to flac and streaming through node.js

Am trying to create an application which will take data as raw audio wav format and output as FLAC.
Now, I need to stream the input and the output at the same time through node.
Can someone guide me on how can I work this out?
Thanks
As far as I know there is no possibility to do so "live" via the Internet. You can't do so with FLAC format. Only AAC, MP3 an WAV are supported for live-streaming.
You can download the file on the client side and then the client using his or het apps is able to play it.

Livestream of prerecorded flv videos with ffmpeg and red5

My goal is to acheive the following steps :-
rtmp livestream of prerecoreded flv videos using ffmpeg.
videos should be played continuously just like a tv station.
We are currently using red5 and ffmpeg to acheive this goal and we have successfully published the live stream of prerecorded single video to jwplayer using the following conversion command :
for i in *.avi; do ffmpeg -i $i -acodec copy -vcodec copy -f flv rtmp://localhost/oflaDemo/livestream
But the problem comes when we need to livestream two videos one after the other. User have to click play button again in order to stream second video which is not a tv-station thing instead we need to continuously play stream for user instead of clicking on play button on ending of each stream.
Maybe this is helpful, concatenating media files using ffmpeg:
http://ffmpeg.org/trac/ffmpeg/wiki/How%20to%20concatenate%20%28join,%20merge%29%20media%20files
I can suggest, as an alternative, to use Wowza Streaming Engine (commercial software, though developer license is free, but with limit on connections and 180 day validity). I tried the ffmpeg concatenation route, but all in all just a big mess with huge files.
With Wowza You can quite easily create your own playlists with scheduling, put it on repeat etc, through creating your own simple modules in Java or using the premade modules ( http://www.wowza.com/forums/content.php?145-How-to-schedule-streaming-with-Wowza-Streaming-Engine-ServerListenerStreamPublisher )
I've done this and have several live streams of prerecorded video files.

RTSP live streaming from IP Camera

Is it possible to see the live stream of an IP camera using RTSP ?
Example URL: rtsp://public ip:554/1363e66e.mp4
The encoding is mp4 h.264 baseline profile at 320 x 240 resolution.
I followed the Wiki link here.
But I get the error: Prefetch error -2
When I try to play using real player on the nokia e72, I get the error: 'General: System Error'.
Please let me know what I can do about this.
There are no video players on Ovi store that can play the stream either but I am able to play the stream on VLC on the desktop.
You can stream it using ReaPlayer if you don't have VLC player in Ovi store. See the port address range supported by your IP camera. Try the range of 1024 - 2000. RTSP supports VLC, Quicktime and Real player. Using any of these objects you can stream it.
So I think here is the case,
There are a few different mp4 containers. Standard one wont allow you to wrap a real time data into a mp4 container because mp4 needs to have a field/atom in its header called
MDAT and it has information about the file and its size as well.(which is written after the file is completely encoded. )
So unless you wake that you can not stream live stuff in mp4 UNLESS it is fragmented mp4.
Media Foundation will allow you to do this when windows 8 is out( i got the intel from the msdn forum so I dont know how true it is).
I dont know what ffmpeg/Gstreamer is capable of. Again if this is a commercial product you are working on you might run into some licensing issues with ffmpeg.
Look at webrtc.
I am guessing best bet it to use webm or ogg/theora but I am not sure if theora can do what you want, This is something I am also working on.
Please share your findings
Thanks.

Resources