linuxffmpegstreamingvideo-streamingqt-faststart

qt faststart and ffmpeg to generate a live mp4 file


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.


Solution

  • 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: