Skip to content

Commit

Permalink
avformat: add MMTP parser and MMT/TLV demuxer
Browse files Browse the repository at this point in the history
This patch adds an MPEG Media Transport Protocol (MMTP) parser, as defined in ISO/IEC 23008-1, and an MMT protocol over TLV packets (MMT/TLV) demuxer, as defined in ARIB STD-B32. Currently, it supports HEVC, AAC LATM, and ARIB-TTML demuxing.

Since MMTP is designed to transmit over IP, there is no size information within each MMTP packet, and there is no on-disk format defined alongside the protocol. One industrial solution is a simple container format using type–length–value packets, which is defined in ARIB STD-B32.

Another known container format for MMTP is using packet capture (pcap) files which records network packets. This patch does not include the demuxer for this container format.

Signed-off-by: SuperFashi <admin@superfashi.com>
  • Loading branch information
superfashi committed Apr 20, 2024
1 parent a44c346 commit b5816cf
Show file tree
Hide file tree
Showing 9 changed files with 2,099 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ version <next>:
- ffmpeg CLI filtergraph chaining
- LC3/LC3plus demuxer and muxer
- pad_vaapi, drawbox_vaapi filters

- MMTP parser and MMT/TLV demuxer

version 7.0:
- DXV DXT1 encoder
Expand Down
4 changes: 4 additions & 0 deletions doc/demuxers.texi
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,10 @@ Set the sample rate for libopenmpt to output.
Range is from 1000 to INT_MAX. The value default is 48000.
@end table

@section mmttlv

Demuxer for MMT protocol over TLV packets (MMT/TLV), as defined in ARIB STD-B32.

@section mov/mp4/3gp

Demuxer for Quicktime File Format & ISO/IEC Base Media File Format (ISO/IEC 14496-12 or MPEG-4 Part 12, ISO/IEC 15444-12 or JPEG 2000 Part 12).
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/codec_par.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ int avcodec_parameters_to_context(AVCodecContext *codec,
break;
}

av_freep(&codec->extradata);
if (par->extradata) {
av_freep(&codec->extradata);
codec->extradata = av_mallocz(par->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!codec->extradata)
return AVERROR(ENOMEM);
Expand Down
1 change: 1 addition & 0 deletions libavformat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ OBJS-$(CONFIG_MLV_DEMUXER) += mlvdec.o riffdec.o
OBJS-$(CONFIG_MM_DEMUXER) += mm.o
OBJS-$(CONFIG_MMF_DEMUXER) += mmf.o
OBJS-$(CONFIG_MMF_MUXER) += mmf.o rawenc.o
OBJS-$(CONFIG_MMTTLV_DEMUXER) += mmtp.o mmttlv.o
OBJS-$(CONFIG_MODS_DEMUXER) += mods.o
OBJS-$(CONFIG_MOFLEX_DEMUXER) += moflex.o
OBJS-$(CONFIG_MOV_DEMUXER) += mov.o mov_chan.o mov_esds.o \
Expand Down
1 change: 1 addition & 0 deletions libavformat/allformats.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ extern const FFInputFormat ff_mlv_demuxer;
extern const FFInputFormat ff_mm_demuxer;
extern const FFInputFormat ff_mmf_demuxer;
extern const FFOutputFormat ff_mmf_muxer;
extern const FFInputFormat ff_mmttlv_demuxer;
extern const FFInputFormat ff_mods_demuxer;
extern const FFInputFormat ff_moflex_demuxer;
extern const FFInputFormat ff_mov_demuxer;
Expand Down
Loading

0 comments on commit b5816cf

Please sign in to comment.