Is it possible to play an output video file from an encoder as it's being encoded?

后端 未结 3 1626
北荒
北荒 2021-02-01 11:08

I have a video file, and I need to encode it as H264/AVC and feed to client via HTTP. What i need is that i player at client side can play back the video as it is being encoded.

3条回答
  •  忘了有多久
    2021-02-01 11:27

    You can move the MOOV Atom to the beginning of a file by rewriting the file using a tool in ffmpeg called qt-faststart. You will need to compile it yourself from source code (but is quite easy at least in Linux / Mac OS). Just download the source of libavcodec, for example: http://libav.org/releases/libav-0.8.tar.xz

    Untar it and go the tools directory, there is a file called qt-faststart.c, just build it with:

    make qt-faststart

    you can now reallocate MOOV Atom by calling it like this: qt-faststart input.mp4 output.mp4

提交回复
热议问题