avformat/rawenc: add H266/VVC muxer

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
Thomas Siedel 2023-03-21 16:01:20 +01:00 committed by James Almer
parent ac2b25f4e5
commit 45a8a62df9
4 changed files with 26 additions and 1 deletions

View File

@ -22,7 +22,7 @@ version <next>:
- bwdif_cuda filter
- Microsoft RLE video encoder
- Raw AC-4 muxer and demuxer
- Raw VVC bitstream parser and demuxer
- Raw VVC bitstream parser, muxer and demuxer
- Bitstream filter for editing metadata in VVC streams
- Bitstream filter for converting VVC from MP4 to Annex B

View File

@ -604,6 +604,7 @@ OBJS-$(CONFIG_VPK_DEMUXER) += vpk.o
OBJS-$(CONFIG_VPLAYER_DEMUXER) += vplayerdec.o subtitles.o
OBJS-$(CONFIG_VQF_DEMUXER) += vqf.o
OBJS-$(CONFIG_VVC_DEMUXER) += vvcdec.o rawdec.o
OBJS-$(CONFIG_VVC_MUXER) += rawenc.o
OBJS-$(CONFIG_W64_DEMUXER) += wavdec.o w64.o pcm.o
OBJS-$(CONFIG_W64_MUXER) += wavenc.o w64.o
OBJS-$(CONFIG_WADY_DEMUXER) += wady.o pcm.o

View File

@ -487,6 +487,7 @@ extern const AVInputFormat ff_vpk_demuxer;
extern const AVInputFormat ff_vplayer_demuxer;
extern const AVInputFormat ff_vqf_demuxer;
extern const AVInputFormat ff_vvc_demuxer;
extern const FFOutputFormat ff_vvc_muxer;
extern const AVInputFormat ff_w64_demuxer;
extern const FFOutputFormat ff_w64_muxer;
extern const AVInputFormat ff_wady_demuxer;

View File

@ -378,6 +378,29 @@ const FFOutputFormat ff_h264_muxer = {
};
#endif
#if CONFIG_VVC_MUXER
static int vvc_check_bitstream(AVFormatContext *s, AVStream *st,
const AVPacket *pkt)
{
if (pkt->size >= 5 && AV_RB32(pkt->data) != 0x0000001 &&
AV_RB24(pkt->data) != 0x000001)
return ff_stream_add_bitstream_filter(st, "vvc_mp4toannexb", NULL);
return 1;
}
const FFOutputFormat ff_vvc_muxer = {
.p.name = "vvc",
.p.long_name = NULL_IF_CONFIG_SMALL("raw H.266/VVC video"),
.p.extensions = "vvc,h266,266",
.p.audio_codec = AV_CODEC_ID_NONE,
.p.video_codec = AV_CODEC_ID_VVC,
.init = force_one_stream,
.write_packet = ff_raw_write_packet,
.check_bitstream = vvc_check_bitstream,
.p.flags = AVFMT_NOTIMESTAMPS,
};
#endif
#if CONFIG_HEVC_MUXER
static int hevc_check_bitstream(AVFormatContext *s, AVStream *st,
const AVPacket *pkt)