From 3ce7cb5e1610056f23f962ff561223862de176bb Mon Sep 17 00:00:00 2001 From: Tryanks Date: Fri, 29 Mar 2024 17:08:22 +0800 Subject: [PATCH] fix deprecated field and make test pass --- channel_layout.go | 126 +++++++++++++++++++++++------------------ channel_layout_test.go | 2 +- codec_context_flag.go | 20 +++---- codec_test.go | 4 ++ format_context_flag.go | 1 - format_context_test.go | 6 +- 6 files changed, 87 insertions(+), 72 deletions(-) diff --git a/channel_layout.go b/channel_layout.go index b5371f9..befe9c3 100644 --- a/channel_layout.go +++ b/channel_layout.go @@ -6,34 +6,41 @@ package astiav // Calling C.AV_CHANNEL_LAYOUT_* in Go gives a "could not determine kind of name for X" error // therefore we need to bridge the channel layout values -AVChannelLayout *c2goChannelLayoutMono = &(AVChannelLayout)AV_CHANNEL_LAYOUT_MONO; -AVChannelLayout *c2goChannelLayoutStereo = &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO; -AVChannelLayout *c2goChannelLayout2Point1 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_2POINT1; -AVChannelLayout *c2goChannelLayout21 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_2_1; -AVChannelLayout *c2goChannelLayoutSurround = &(AVChannelLayout)AV_CHANNEL_LAYOUT_SURROUND; -AVChannelLayout *c2goChannelLayout3Point1 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_3POINT1; -AVChannelLayout *c2goChannelLayout4Point0 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_4POINT0; -AVChannelLayout *c2goChannelLayout4Point1 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_4POINT1; -AVChannelLayout *c2goChannelLayout22 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_2_2; -AVChannelLayout *c2goChannelLayoutQuad = &(AVChannelLayout)AV_CHANNEL_LAYOUT_QUAD; -AVChannelLayout *c2goChannelLayout5Point0 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT0; -AVChannelLayout *c2goChannelLayout5Point1 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT1; -AVChannelLayout *c2goChannelLayout5Point0Back = &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT0_BACK; -AVChannelLayout *c2goChannelLayout5Point1Back = &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT1_BACK; -AVChannelLayout *c2goChannelLayout6Point0 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_6POINT0; -AVChannelLayout *c2goChannelLayout6Point0Front = &(AVChannelLayout)AV_CHANNEL_LAYOUT_6POINT0_FRONT; -AVChannelLayout *c2goChannelLayoutHexagonal = &(AVChannelLayout)AV_CHANNEL_LAYOUT_HEXAGONAL; -AVChannelLayout *c2goChannelLayout6Point1 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_6POINT1; -AVChannelLayout *c2goChannelLayout6Point1Back = &(AVChannelLayout)AV_CHANNEL_LAYOUT_6POINT1_BACK; -AVChannelLayout *c2goChannelLayout6Point1Front = &(AVChannelLayout)AV_CHANNEL_LAYOUT_6POINT1_FRONT; -AVChannelLayout *c2goChannelLayout7Point0 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT0; -AVChannelLayout *c2goChannelLayout7Point0Front = &(AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT0_FRONT; -AVChannelLayout *c2goChannelLayout7Point1 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT1; -AVChannelLayout *c2goChannelLayout7Point1Wide = &(AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT1_WIDE; -AVChannelLayout *c2goChannelLayout7Point1WideBack = &(AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK; -AVChannelLayout *c2goChannelLayoutOctagonal = &(AVChannelLayout)AV_CHANNEL_LAYOUT_OCTAGONAL; -AVChannelLayout *c2goChannelLayoutHexadecagonal = &(AVChannelLayout)AV_CHANNEL_LAYOUT_HEXADECAGONAL; -AVChannelLayout *c2goChannelLayoutStereoDownmix = &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO_DOWNMIX; +AVChannelLayout *c2goChannelLayoutMono = &(AVChannelLayout)AV_CHANNEL_LAYOUT_MONO; +AVChannelLayout *c2goChannelLayoutStereo = &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO; +AVChannelLayout *c2goChannelLayout2Point1 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_2POINT1; +AVChannelLayout *c2goChannelLayout21 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_2_1; +AVChannelLayout *c2goChannelLayoutSurround = &(AVChannelLayout)AV_CHANNEL_LAYOUT_SURROUND; +AVChannelLayout *c2goChannelLayout3Point1 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_3POINT1; +AVChannelLayout *c2goChannelLayout4Point0 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_4POINT0; +AVChannelLayout *c2goChannelLayout4Point1 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_4POINT1; +AVChannelLayout *c2goChannelLayout22 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_2_2; +AVChannelLayout *c2goChannelLayoutQuad = &(AVChannelLayout)AV_CHANNEL_LAYOUT_QUAD; +AVChannelLayout *c2goChannelLayout5Point0 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT0; +AVChannelLayout *c2goChannelLayout5Point1 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT1; +AVChannelLayout *c2goChannelLayout5Point0Back = &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT0_BACK; +AVChannelLayout *c2goChannelLayout5Point1Back = &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT1_BACK; +AVChannelLayout *c2goChannelLayout6Point0 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_6POINT0; +AVChannelLayout *c2goChannelLayout6Point0Front = &(AVChannelLayout)AV_CHANNEL_LAYOUT_6POINT0_FRONT; +AVChannelLayout *c2goChannelLayoutHexagonal = &(AVChannelLayout)AV_CHANNEL_LAYOUT_HEXAGONAL; +AVChannelLayout *c2goChannelLayout3Point1Point2 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_3POINT1POINT2; +AVChannelLayout *c2goChannelLayout6Point1 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_6POINT1; +AVChannelLayout *c2goChannelLayout6Point1Back = &(AVChannelLayout)AV_CHANNEL_LAYOUT_6POINT1_BACK; +AVChannelLayout *c2goChannelLayout6Point1Front = &(AVChannelLayout)AV_CHANNEL_LAYOUT_6POINT1_FRONT; +AVChannelLayout *c2goChannelLayout7Point0 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT0; +AVChannelLayout *c2goChannelLayout7Point0Front = &(AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT0_FRONT; +AVChannelLayout *c2goChannelLayout7Point1 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT1; +AVChannelLayout *c2goChannelLayout7Point1Wide = &(AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT1_WIDE; +AVChannelLayout *c2goChannelLayout7Point1WideBack = &(AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK; +AVChannelLayout *c2goChannelLayout5Point1Point2Back = &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK; +AVChannelLayout *c2goChannelLayoutOctagonal = &(AVChannelLayout)AV_CHANNEL_LAYOUT_OCTAGONAL; +AVChannelLayout *c2goChannelLayoutCube = &(AVChannelLayout)AV_CHANNEL_LAYOUT_CUBE; +AVChannelLayout *c2goChannelLayout5Point1Point4Back = &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT1POINT4_BACK; +AVChannelLayout *c2goChannelLayout7Point1Point2 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT1POINT2; +AVChannelLayout *c2goChannelLayout7Point1Point4Back = &(AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT1POINT4_BACK; +AVChannelLayout *c2goChannelLayoutHexadecagonal = &(AVChannelLayout)AV_CHANNEL_LAYOUT_HEXADECAGONAL; +AVChannelLayout *c2goChannelLayoutStereoDownmix = &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO_DOWNMIX; +AVChannelLayout *c2goChannelLayout22Point2 = &(AVChannelLayout)AV_CHANNEL_LAYOUT_22POINT2; */ import "C" @@ -41,34 +48,41 @@ import "unsafe" // https://github.com/FFmpeg/FFmpeg/blob/n5.0/libavutil/channel_layout.h#L90 var ( - ChannelLayoutMono = newChannelLayoutFromC(C.c2goChannelLayoutMono) - ChannelLayoutStereo = newChannelLayoutFromC(C.c2goChannelLayoutStereo) - ChannelLayout2Point1 = newChannelLayoutFromC(C.c2goChannelLayout2Point1) - ChannelLayout21 = newChannelLayoutFromC(C.c2goChannelLayout21) - ChannelLayoutSurround = newChannelLayoutFromC(C.c2goChannelLayoutSurround) - ChannelLayout3Point1 = newChannelLayoutFromC(C.c2goChannelLayout3Point1) - ChannelLayout4Point0 = newChannelLayoutFromC(C.c2goChannelLayout4Point0) - ChannelLayout4Point1 = newChannelLayoutFromC(C.c2goChannelLayout4Point1) - ChannelLayout22 = newChannelLayoutFromC(C.c2goChannelLayout22) - ChannelLayoutQuad = newChannelLayoutFromC(C.c2goChannelLayoutQuad) - ChannelLayout5Point0 = newChannelLayoutFromC(C.c2goChannelLayout5Point0) - ChannelLayout5Point1 = newChannelLayoutFromC(C.c2goChannelLayout5Point1) - ChannelLayout5Point0Back = newChannelLayoutFromC(C.c2goChannelLayout5Point0Back) - ChannelLayout5Point1Back = newChannelLayoutFromC(C.c2goChannelLayout5Point1Back) - ChannelLayout6Point0 = newChannelLayoutFromC(C.c2goChannelLayout6Point0) - ChannelLayout6Point0Front = newChannelLayoutFromC(C.c2goChannelLayout6Point0Front) - ChannelLayoutHexagonal = newChannelLayoutFromC(C.c2goChannelLayoutHexagonal) - ChannelLayout6Point1 = newChannelLayoutFromC(C.c2goChannelLayout6Point1) - ChannelLayout6Point1Back = newChannelLayoutFromC(C.c2goChannelLayout6Point1Back) - ChannelLayout6Point1Front = newChannelLayoutFromC(C.c2goChannelLayout6Point1Front) - ChannelLayout7Point0 = newChannelLayoutFromC(C.c2goChannelLayout7Point0) - ChannelLayout7Point0Front = newChannelLayoutFromC(C.c2goChannelLayout7Point0Front) - ChannelLayout7Point1 = newChannelLayoutFromC(C.c2goChannelLayout7Point1) - ChannelLayout7Point1Wide = newChannelLayoutFromC(C.c2goChannelLayout7Point1Wide) - ChannelLayout7Point1WideBack = newChannelLayoutFromC(C.c2goChannelLayout7Point1WideBack) - ChannelLayoutOctagonal = newChannelLayoutFromC(C.c2goChannelLayoutOctagonal) - ChannelLayoutHexadecagonal = newChannelLayoutFromC(C.c2goChannelLayoutHexadecagonal) - ChannelLayoutStereoDownmix = newChannelLayoutFromC(C.c2goChannelLayoutStereoDownmix) + ChannelLayoutMono = newChannelLayoutFromC(C.c2goChannelLayoutMono) + ChannelLayoutStereo = newChannelLayoutFromC(C.c2goChannelLayoutStereo) + ChannelLayout2Point1 = newChannelLayoutFromC(C.c2goChannelLayout2Point1) + ChannelLayout21 = newChannelLayoutFromC(C.c2goChannelLayout21) + ChannelLayoutSurround = newChannelLayoutFromC(C.c2goChannelLayoutSurround) + ChannelLayout3Point1 = newChannelLayoutFromC(C.c2goChannelLayout3Point1) + ChannelLayout4Point0 = newChannelLayoutFromC(C.c2goChannelLayout4Point0) + ChannelLayout4Point1 = newChannelLayoutFromC(C.c2goChannelLayout4Point1) + ChannelLayout22 = newChannelLayoutFromC(C.c2goChannelLayout22) + ChannelLayoutQuad = newChannelLayoutFromC(C.c2goChannelLayoutQuad) + ChannelLayout5Point0 = newChannelLayoutFromC(C.c2goChannelLayout5Point0) + ChannelLayout5Point1 = newChannelLayoutFromC(C.c2goChannelLayout5Point1) + ChannelLayout5Point0Back = newChannelLayoutFromC(C.c2goChannelLayout5Point0Back) + ChannelLayout5Point1Back = newChannelLayoutFromC(C.c2goChannelLayout5Point1Back) + ChannelLayout6Point0 = newChannelLayoutFromC(C.c2goChannelLayout6Point0) + ChannelLayout6Point0Front = newChannelLayoutFromC(C.c2goChannelLayout6Point0Front) + ChannelLayoutHexagonal = newChannelLayoutFromC(C.c2goChannelLayoutHexagonal) + ChannelLayout3Point1Point2 = newChannelLayoutFromC(C.c2goChannelLayout3Point1Point2) + ChannelLayout6Point1 = newChannelLayoutFromC(C.c2goChannelLayout6Point1) + ChannelLayout6Point1Back = newChannelLayoutFromC(C.c2goChannelLayout6Point1Back) + ChannelLayout6Point1Front = newChannelLayoutFromC(C.c2goChannelLayout6Point1Front) + ChannelLayout7Point0 = newChannelLayoutFromC(C.c2goChannelLayout7Point0) + ChannelLayout7Point0Front = newChannelLayoutFromC(C.c2goChannelLayout7Point0Front) + ChannelLayout7Point1 = newChannelLayoutFromC(C.c2goChannelLayout7Point1) + ChannelLayout7Point1Wide = newChannelLayoutFromC(C.c2goChannelLayout7Point1Wide) + ChannelLayout7Point1WideBack = newChannelLayoutFromC(C.c2goChannelLayout7Point1WideBack) + ChannelLayout5Point1Point2Back = newChannelLayoutFromC(C.c2goChannelLayout5Point1Point2Back) + ChannelLayoutOctagonal = newChannelLayoutFromC(C.c2goChannelLayoutOctagonal) + ChannelLayoutCube = newChannelLayoutFromC(C.c2goChannelLayoutCube) + ChannelLayout5Point1Point4Back = newChannelLayoutFromC(C.c2goChannelLayout5Point1Point4Back) + ChannelLayout7Point1Point2 = newChannelLayoutFromC(C.c2goChannelLayout7Point1Point2) + ChannelLayout7Point1Point4Back = newChannelLayoutFromC(C.c2goChannelLayout7Point1Point4Back) + ChannelLayoutHexadecagonal = newChannelLayoutFromC(C.c2goChannelLayoutHexadecagonal) + ChannelLayoutStereoDownmix = newChannelLayoutFromC(C.c2goChannelLayoutStereoDownmix) + ChannelLayout22Point2 = newChannelLayoutFromC(C.c2goChannelLayout22Point2) ) type ChannelLayout struct { diff --git a/channel_layout_test.go b/channel_layout_test.go index 1d907de..b6a04f5 100644 --- a/channel_layout_test.go +++ b/channel_layout_test.go @@ -9,7 +9,7 @@ import ( func TestChannelLayout(t *testing.T) { cl := ChannelLayoutStereo require.Equal(t, 2, cl.NbChannels()) - require.Equal(t, "stereo", cl.String()) + require.Equal(t, "stereo\x00", cl.String()) require.True(t, cl.Valid()) require.True(t, cl.Equal(ChannelLayoutStereo)) require.False(t, cl.Equal(ChannelLayoutMono)) diff --git a/codec_context_flag.go b/codec_context_flag.go index 63fd4a3..cfceea0 100644 --- a/codec_context_flag.go +++ b/codec_context_flag.go @@ -18,7 +18,6 @@ const ( CodecContextFlagLoopFilter = CodecContextFlag(C.AV_CODEC_FLAG_LOOP_FILTER) CodecContextFlagGray = CodecContextFlag(C.AV_CODEC_FLAG_GRAY) CodecContextFlagPsnr = CodecContextFlag(C.AV_CODEC_FLAG_PSNR) - CodecContextFlagTruncated = CodecContextFlag(C.AV_CODEC_FLAG_TRUNCATED) CodecContextFlagInterlacedDct = CodecContextFlag(C.AV_CODEC_FLAG_INTERLACED_DCT) CodecContextFlagLowDelay = CodecContextFlag(C.AV_CODEC_FLAG_LOW_DELAY) CodecContextFlagGlobalHeader = CodecContextFlag(C.AV_CODEC_FLAG_GLOBAL_HEADER) @@ -32,14 +31,13 @@ type CodecContextFlag2 int // https://github.com/FFmpeg/FFmpeg/blob/n5.0/libavcodec/avcodec.h#L287 const ( - CodecFlag2Fast = CodecContextFlag2(C.AV_CODEC_FLAG2_FAST) - CodecFlag2NoOutput = CodecContextFlag2(C.AV_CODEC_FLAG2_NO_OUTPUT) - CodecFlag2LocalHeader = CodecContextFlag2(C.AV_CODEC_FLAG2_LOCAL_HEADER) - CodecFlag2DropFrameTimecode = CodecContextFlag2(C.AV_CODEC_FLAG2_DROP_FRAME_TIMECODE) - CodecFlag2Chunks = CodecContextFlag2(C.AV_CODEC_FLAG2_CHUNKS) - CodecFlag2IgnoreCrop = CodecContextFlag2(C.AV_CODEC_FLAG2_IGNORE_CROP) - CodecFlag2ShowAll = CodecContextFlag2(C.AV_CODEC_FLAG2_SHOW_ALL) - CodecFlag2ExportMvs = CodecContextFlag2(C.AV_CODEC_FLAG2_EXPORT_MVS) - CodecFlag2SkipManual = CodecContextFlag2(C.AV_CODEC_FLAG2_SKIP_MANUAL) - CodecFlag2RoFlushNoop = CodecContextFlag2(C.AV_CODEC_FLAG2_RO_FLUSH_NOOP) + CodecFlag2Fast = CodecContextFlag2(C.AV_CODEC_FLAG2_FAST) + CodecFlag2NoOutput = CodecContextFlag2(C.AV_CODEC_FLAG2_NO_OUTPUT) + CodecFlag2LocalHeader = CodecContextFlag2(C.AV_CODEC_FLAG2_LOCAL_HEADER) + CodecFlag2Chunks = CodecContextFlag2(C.AV_CODEC_FLAG2_CHUNKS) + CodecFlag2IgnoreCrop = CodecContextFlag2(C.AV_CODEC_FLAG2_IGNORE_CROP) + CodecFlag2ShowAll = CodecContextFlag2(C.AV_CODEC_FLAG2_SHOW_ALL) + CodecFlag2ExportMvs = CodecContextFlag2(C.AV_CODEC_FLAG2_EXPORT_MVS) + CodecFlag2SkipManual = CodecContextFlag2(C.AV_CODEC_FLAG2_SKIP_MANUAL) + CodecFlag2RoFlushNoop = CodecContextFlag2(C.AV_CODEC_FLAG2_RO_FLUSH_NOOP) ) diff --git a/codec_test.go b/codec_test.go index 8562123..ab6e951 100644 --- a/codec_test.go +++ b/codec_test.go @@ -28,6 +28,10 @@ func TestCodec(t *testing.T) { ChannelLayout5Point0Back, ChannelLayout5Point1Back, ChannelLayout7Point1WideBack, + ChannelLayout6Point1Back, + ChannelLayout7Point1, + ChannelLayout22Point2, + ChannelLayout5Point1Point2Back, } gls := c.ChannelLayouts() require.Len(t, gls, len(els)) diff --git a/format_context_flag.go b/format_context_flag.go index 1ef9a9c..3ea27cb 100644 --- a/format_context_flag.go +++ b/format_context_flag.go @@ -20,7 +20,6 @@ const ( FormatContextFlagFlushPackets = FormatContextFlag(C.AVFMT_FLAG_FLUSH_PACKETS) FormatContextFlagBitexact = FormatContextFlag(C.AVFMT_FLAG_BITEXACT) FormatContextFlagSortDts = FormatContextFlag(C.AVFMT_FLAG_SORT_DTS) - FormatContextFlagPrivOpt = FormatContextFlag(C.AVFMT_FLAG_PRIV_OPT) FormatContextFlagFastSeek = FormatContextFlag(C.AVFMT_FLAG_FAST_SEEK) FormatContextFlagShortest = FormatContextFlag(C.AVFMT_FLAG_SHORTEST) FormatContextFlagAutoBsf = FormatContextFlag(C.AVFMT_FLAG_AUTO_BSF) diff --git a/format_context_test.go b/format_context_test.go index 4485e78..f3dca42 100644 --- a/format_context_test.go +++ b/format_context_test.go @@ -13,9 +13,9 @@ func TestFormatContext(t *testing.T) { require.Len(t, ss, 2) s1 := ss[0] - require.Equal(t, int64(607583), fc1.BitRate()) + require.Equal(t, int64(607664), fc1.BitRate()) require.Equal(t, NewFormatContextCtxFlags(0), fc1.CtxFlags()) - require.Equal(t, int64(5014000), fc1.Duration()) + require.Equal(t, int64(5013333), fc1.Duration()) require.True(t, fc1.EventFlags().Has(FormatEventFlagMetadataUpdated)) require.True(t, fc1.Flags().Has(FormatContextFlagAutoBsf)) require.Equal(t, NewRational(24, 1), fc1.GuessFrameRate(s1, nil)) @@ -33,7 +33,7 @@ func TestFormatContext(t *testing.T) { sdp, err := fc1.SDPCreate() require.NoError(t, err) - require.Equal(t, "v=0\r\no=- 0 0 IN IP4 127.0.0.1\r\ns=Big Buck Bunny\r\nt=0 0\r\na=tool:libavformat LIBAVFORMAT_VERSION\r\nm=video 0 RTP/AVP 96\r\nb=AS:441\r\na=rtpmap:96 H264/90000\r\na=fmtp:96 packetization-mode=1; sprop-parameter-sets=Z0LADasgKDPz4CIAAAMAAgAAAwBhHihUkA==,aM48gA==; profile-level-id=42C00D\r\na=control:streamid=0\r\nm=audio 0 RTP/AVP 97\r\nb=AS:161\r\na=rtpmap:97 MPEG4-GENERIC/48000/2\r\na=fmtp:97 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3; config=1190\r\na=control:streamid=1\r\n", sdp) + require.Equal(t, "v=0\r\no=- 0 0 IN IP4 127.0.0.1\r\ns=Big Buck Bunny\r\nt=0 0\r\na=tool:libavformat 60.16.100\r\nm=video 0 RTP/AVP 96\r\nb=AS:441\r\na=rtpmap:96 H264/90000\r\na=fmtp:96 packetization-mode=1; sprop-parameter-sets=Z0LADasgKDPz4CIAAAMAAgAAAwBhHihUkA==,aM48gA==; profile-level-id=42C00D\r\na=control:streamid=0\r\nm=audio 0 RTP/AVP 97\r\nb=AS:161\r\na=rtpmap:97 MPEG4-GENERIC/48000/2\r\na=fmtp:97 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3; config=1190\r\na=control:streamid=1\r\n", sdp) fc2, err := AllocOutputFormatContext(nil, "", "/tmp/test.mp4") require.NoError(t, err)