Re: [FFmpeg-devel] Patch to libavc/opus to create extradata if missing

2022-07-06 Thread Tristan Matthews
On Wed, Jul 6, 2022 at 10:10 AM Tristan Matthews wrote: > Hi, > > On Sun, Jan 3, 2021 at 8:09 PM Andreas Rheinhardt < > andreas.rheinha...@gmail.com> wrote: > >> Jonathan Baudanza: >> > On Sun, Jan 3, 2021, at 3:34 PM, Andreas Rheinhardt wrote: >> >> Lynne: >> >>> >> >>> Apart from that LGTM. >>

Re: [FFmpeg-devel] Patch to libavc/opus to create extradata if missing

2022-07-06 Thread Tristan Matthews
Hi, On Sun, Jan 3, 2021 at 8:09 PM Andreas Rheinhardt < andreas.rheinha...@gmail.com> wrote: > Jonathan Baudanza: > > On Sun, Jan 3, 2021, at 3:34 PM, Andreas Rheinhardt wrote: > >> Lynne: > >>> > >>> Apart from that LGTM. > >> > >> +1 if the case of more than two channels has been properly teste

Re: [FFmpeg-devel] Patch to libavc/opus to create extradata if missing

2021-01-03 Thread Andreas Rheinhardt
Jonathan Baudanza: > On Sun, Jan 3, 2021, at 3:34 PM, Andreas Rheinhardt wrote: >> Lynne: >>> >>> Apart from that LGTM. >> >> +1 if the case of more than two channels has been properly tested. >> > > I tested this by creating an (invalid) SDP file with channels set to 3. In > this case, the rtp d

Re: [FFmpeg-devel] Patch to libavc/opus to create extradata if missing

2021-01-03 Thread Jonathan Baudanza
On Sun, Jan 3, 2021, at 3:34 PM, Andreas Rheinhardt wrote: > Lynne: > > > > Apart from that LGTM. > > +1 if the case of more than two channels has been properly tested. > I tested this by creating an (invalid) SDP file with channels set to 3. In this case, the rtp demuxer fails with the followi

Re: [FFmpeg-devel] Patch to libavc/opus to create extradata if missing

2021-01-03 Thread Andreas Rheinhardt
Lynne: > Jan 3, 2021, 23:48 by j...@jonb.org: > >> >> >> On Sun, Jan 3, 2021, at 2:25 PM, Lynne wrote: >> +/* Input sample rate (0 = unspecified) */> +bytestream_put_le32 (&bs, 0); >>> Put in 48000 here. Stream copy will preserve extradata, and we don't want to >>> generate wei

Re: [FFmpeg-devel] Patch to libavc/opus to create extradata if missing

2021-01-03 Thread Jonathan Baudanza
On Sun, Jan 3, 2021, at 3:33 PM, James Almer wrote: > > Made those changes and pushed it. Thanks for your help everyone! Looking forward to deploying this! ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-

Re: [FFmpeg-devel] Patch to libavc/opus to create extradata if missing

2021-01-03 Thread James Almer
On 1/3/2021 8:05 PM, Lynne wrote: Jan 3, 2021, 23:48 by j...@jonb.org: On Sun, Jan 3, 2021, at 2:25 PM, Lynne wrote: +/* Input sample rate (0 = unspecified) */> +bytestream_put_le32 (&bs, 0); Put in 48000 here. Stream copy will preserve extradata, and we don't want to generate we

Re: [FFmpeg-devel] Patch to libavc/opus to create extradata if missing

2021-01-03 Thread Lynne
Jan 3, 2021, 23:48 by j...@jonb.org: > > > On Sun, Jan 3, 2021, at 2:25 PM, Lynne wrote: > >> > +/* Input sample rate (0 = unspecified) */> +bytestream_put_le32 >> > (&bs, 0); >> Put in 48000 here. Stream copy will preserve extradata, and we don't want to >> generate weird streams, even

Re: [FFmpeg-devel] Patch to libavc/opus to create extradata if missing

2021-01-03 Thread Jonathan Baudanza
On Sun, Jan 3, 2021, at 2:25 PM, Lynne wrote: > > +/* Input sample rate (0 = unspecified) */> +bytestream_put_le32 > > (&bs, 0); > Put in 48000 here. Stream copy will preserve extradata, and we don't want to > generate weird streams, even if our decoder ignores this. > > > +/* Chan

Re: [FFmpeg-devel] Patch to libavc/opus to create extradata if missing

2021-01-03 Thread Lynne
Jan 3, 2021, 23:06 by j...@jonb.org: > On Sun, Jan 3, 2021, at 12:50 PM, Andreas Rheinhardt wrote: > >> >> It would be better if you used ff_alloc_extradata(): It also already >> frees the extradata that might be present. And it does only set the >> extradata_size after the allocation succeeded. B

Re: [FFmpeg-devel] Patch to libavc/opus to create extradata if missing

2021-01-03 Thread Jonathan Baudanza
On Sun, Jan 3, 2021, at 12:50 PM, Andreas Rheinhardt wrote: > > It would be better if you used ff_alloc_extradata(): It also already > frees the extradata that might be present. And it does only set the > extradata_size after the allocation succeeded. But it is of course even > better if you actua

Re: [FFmpeg-devel] Patch to libavc/opus to create extradata if missing

2021-01-03 Thread Andreas Rheinhardt
Jonathan Baudanza: > On Wed, Dec 30, 2020, at 10:34 AM, James Almer wrote: > >> Nothing should have done it at that point. The demuxer allocates the >> AVStream after all. But to be sure you can do >> av_freep(&st->codecpar->extradata) to ensure it's NULL before anything >> else is done. > > T

Re: [FFmpeg-devel] Patch to libavc/opus to create extradata if missing

2021-01-03 Thread Jonathan Baudanza
On Wed, Dec 30, 2020, at 10:34 AM, James Almer wrote: > Nothing should have done it at that point. The demuxer allocates the > AVStream after all. But to be sure you can do > av_freep(&st->codecpar->extradata) to ensure it's NULL before anything > else is done. Thanks James. I've updated the

Re: [FFmpeg-devel] Patch to libavc/opus to create extradata if missing

2020-12-30 Thread James Almer
On 12/30/2020 3:00 PM, Jonathan Baudanza wrote: On Tue, Dec 29, 2020, at 3:25 PM, Jonathan Baudanza wrote: Thank you for all the feedback everyone. I've updated the patch to build the opus header inside of ff_rtp_parse_open in libavformat/rtpdec.c. I set the mapping_family to 0, since I belie

Re: [FFmpeg-devel] Patch to libavc/opus to create extradata if missing

2020-12-30 Thread Jonathan Baudanza
On Tue, Dec 29, 2020, at 3:25 PM, Jonathan Baudanza wrote: > Thank you for all the feedback everyone. I've updated the patch to build the > opus header inside of ff_rtp_parse_open in libavformat/rtpdec.c. > > I set the mapping_family to 0, since I believe Opus/RTP only supports 2 > channels. I

Re: [FFmpeg-devel] Patch to libavc/opus to create extradata if missing

2020-12-29 Thread Jonathan Baudanza
On Tue, Dec 29, 2020, at 6:41 AM, Lynne wrote: > Dec 28, 2020, 19:03 by j...@jonb.org: > > >> Actually its not impossible to create extradata from raw Opus streams. > >> The extradata only contains a magic, #channes, padding, a sample rate and > >> a channel_family. > >> > >> We know the magic, th

Re: [FFmpeg-devel] Patch to libavc/opus to create extradata if missing

2020-12-29 Thread Lynne
Dec 28, 2020, 19:03 by j...@jonb.org: >> Actually its not impossible to create extradata from raw Opus streams. >> The extradata only contains a magic, #channes, padding, a sample rate and >> a channel_family. >> >> We know the magic, the #channels can be found out via the packet's >> contents and

Re: [FFmpeg-devel] Patch to libavc/opus to create extradata if missing

2020-12-28 Thread Jonathan Baudanza
> Actually its not impossible to create extradata from raw Opus streams. > The extradata only contains a magic, #channes, padding, a sample rate and > a channel_family. > > We know the magic, the #channels can be found out via the packet's > contents and whether it contains multiple packets, the p

Re: [FFmpeg-devel] Patch to libavc/opus to create extradata if missing

2020-12-28 Thread Lynne
Dec 28, 2020, 14:34 by jamr...@gmail.com: > On 12/28/2020 6:53 AM, Andreas Rheinhardt wrote: > >> Jonathan Baudanza: >> >>> This patch to libavcodec/opus.c will create the opus extradata if it is >>> missing. This is required when muxing opus data from an RTP demuxer. >>> Without this patch, the

Re: [FFmpeg-devel] Patch to libavc/opus to create extradata if missing

2020-12-28 Thread James Almer
On 12/28/2020 6:53 AM, Andreas Rheinhardt wrote: Jonathan Baudanza: This patch to libavcodec/opus.c will create the opus extradata if it is missing. This is required when muxing opus data from an RTP demuxer. Without this patch, the opux muxer will fail with a "No extradata present" error. A

Re: [FFmpeg-devel] Patch to libavc/opus to create extradata if missing

2020-12-28 Thread Andreas Rheinhardt
Jonathan Baudanza: > This patch to libavcodec/opus.c will create the opus extradata if it is > missing. This is required when muxing opus data from an RTP demuxer. Without > this patch, the opux muxer will fail with a "No extradata present" error. > > This issue was first reported by Juan Navar