]> git.sesse.net Git - ffmpeg/commit
avformat/avio: Add Metacube support master
authorSteinar H. Gunderson <steinar+ffmpeg@gunderson.no>
Sun, 2 May 2021 21:45:09 +0000 (23:45 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 3 May 2021 18:35:57 +0000 (20:35 +0200)
commiteb45a2188fb8d018bb5fbb0b54706c9e7b6a3749
tree98ba90e60116235dae747ed9b347edf2e7645246
parentc7c138e411dec64a80782ee230837f8a0925726d
avformat/avio: Add Metacube support

Support wrapping the output format in Metacube, as used by the Cubemap
stream reflector (originally designed for VLC). This is nominally meant
to run over HTTP, but longer-term would probably also be useful for
pipe output as a subprocess of Cubemap.

Integrating with Cubemap instantly gives FFmpeg access to a high-performance
(40Gbit++/sec on a regular quadcore, with TLS), multi-user, proven HTTP
reflector -- FFmpeg's own HTTP server still only has experimental multi-user
support. However, Cubemap is deliberately dumb and thus does not understand any
muxes; it is dependent on the origin (e.g. FFmpeg) to mark which bytes are
headers, and at which bytes new clients can start the stream, which is why
it needs its input wrapped in Metacube.

Metacube output is activated by -fflags metacube. E.g., to create streamable
MP4 on port 9095 that Cubemap can pick up and reflect:

  ffmpeg -i <input> -f mp4 -movflags empty_moov+frag_keyframe+default_base_moof+skip_trailer \
    -frag_duration 125000 -fflags metacube -listen 1 'http://[::]:9095'

Tested with MP4 and Matroska.

The metacube2.h header comes from the Cubemap distribution, and is nominally
public domain. It can be considered to be licensed under the LGPL 2.1, like
the rest of FFmpeg.

Signed-off-by: Steinar H. Gunderson <steinar+ffmpeg@gunderson.no>
fftools/ffmpeg_opt.c
libavformat/avformat.h
libavformat/avio.h
libavformat/aviobuf.c
libavformat/http.c
libavformat/metacube2.h [new file with mode: 0644]
libavformat/movenc.c
libavformat/options_table.h