[Libav-user] Creating seekable video files without seekable IO

Ondřej Perutka perutka.ondrej at gmail.com
Wed Sep 18 12:50:18 EEST 2019


Hi,

I'm trying to solve a little puzzle here. I'm looking for a container that
would allow me to create a video file "on the fly" and stream it over HTTP.
But I also need the result to be seekable.

To add more details, I have a storage with MPEG-TS video segments
(thousands of hours of continuous video). I need to create a server
application that would take a given set of continuous segments from the
storage, it would mux it into an appropriate container and stream it over
HTTP to a client. The client can save it as a file, play it back and seek
in it.

The video codec can be either h264 or MJPEG. There can be also an audio in
AAC.

Right now I'm using fragmented MP4 but not all players can seek in it. From
what I understand, the MP4 muxer puts the MOOV atom to the end of the file
by default, so it should be possible. Unfortunately, when I tried to create
a regular MP4 (i.e. not fragmented) with AVIOContext which does not support
seeking, the result wasn't playable.

Please note that I cannot create the whole MP4 file on the server and
stream it via HTTP when it's done. There would be a big delay and I also
want to avoid disk IO because of scalability.

Thanks for your help.

Ondrej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20190918/02b3d8bc/attachment.html>


More information about the Libav-user mailing list