* [FFmpeg-devel] [PATCH v2] avformat/vpcc: fix VP9 metadata in FLV and RTMP
@ 2023-09-03 16:08 Alessandro Ros
0 siblings, 0 replies; 8+ messages in thread
From: Alessandro Ros @ 2023-09-03 16:08 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Alessandro Ros
I integrated James A. comment and fixed patch format.
In order to send VP9 tracks with FLV or RTMP, the enhanced RTMP
specification tells that VPCodecConfigurationRecord, a.k.a. vpcC
ISO-BMFF box, must be inserted into a metadata message. However, the
function responsible for generating vpcCs currently returns invalid
boxes, that are lacking the Version and Flag fields, inherited from
FullBox. For some reason, both flags were being added manually in
movenc. This patch fixes the issue.
Signed-off-by: Alessandro Ros <aler9.dev@gmail.com>
---
libavformat/movenc.c | 3 ---
libavformat/vpcc.c | 2 ++
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 7ef6cef46a..696ae5a6c9 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1441,10 +1441,7 @@ static int mov_write_vpcc_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *tra
avio_wb32(pb, 0);
ffio_wfourcc(pb, "vpcC");
- avio_w8(pb, 1); /* version */
- avio_wb24(pb, 0); /* flags */
ff_isom_write_vpcc(s, pb, track->vos_data, track->vos_len, track->par);
-
return update_size(pb, pos);
}
diff --git a/libavformat/vpcc.c b/libavformat/vpcc.c
index ea66959abf..256407dd6d 100644
--- a/libavformat/vpcc.c
+++ b/libavformat/vpcc.c
@@ -208,6 +208,8 @@ int ff_isom_write_vpcc(AVFormatContext *s, AVIOContext *pb,
if (ret < 0)
return ret;
+ avio_w8(pb, 1); /* version */
+ avio_wb24(pb, 0); /* flags */
avio_w8(pb, vpcc.profile);
avio_w8(pb, vpcc.level);
avio_w8(pb, (vpcc.bitdepth << 4) | (vpcc.chroma_subsampling << 1) | vpcc.full_range_flag);
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2] avformat/vpcc: fix VP9 metadata in FLV and RTMP
2023-09-03 18:49 ` James Almer
@ 2023-09-04 6:24 ` Steven Liu
0 siblings, 0 replies; 8+ messages in thread
From: Steven Liu @ 2023-09-04 6:24 UTC (permalink / raw)
To: FFmpeg development discussions and patches
James Almer <jamrial@gmail.com> 于2023年9月4日周一 02:49写道:
>
> On 9/3/2023 1:45 PM, aler9 wrote:
> > I looked again at your previous comment and you suggested to explicitly
> > mention that this patch will affect FLV too, which i did in the title.
> >
> > I didn't see any request to change the code. Do you have any suggestion
> > regarding the code?
>
> I see the change in the commit message that i had missed, so nevermind.
>
> >
> >
> >
> > Il giorno dom 3 set 2023 alle ore 18:17 James Almer <jamrial@gmail.com> ha
> > scritto:
> >
> >> On 9/3/2023 1:15 PM, aler9 wrote:
> >>> sorry, to git add what?
> >>
> >> You say you integrated my comment, but the contents of the patch are
> >> exactly the same.
> >>
> >>>
> >>> Il giorno dom 3 set 2023 alle ore 18:02 James Almer <jamrial@gmail.com>
> >> ha
> >>> scritto:
> >>>
> >>>> On 9/3/2023 1:00 PM, Alessandro Ros wrote:
> >>>>> I integrated James A. comment and fixed patch format.
> >>>>
> >>>> I think you forgot to git add.
> >>>>
> >>>>>
> >>>>> In order to send VP9 tracks with FLV or RTMP, the enhanced RTMP
> >>>>> specification tells that VPCodecConfigurationRecord, a.k.a. vpcC
> >>>>> ISO-BMFF box, must be inserted into a metadata message. However, the
> >>>>> function responsible for generating vpcCs currently returns invalid
> >>>>> boxes, that are lacking the Version and Flag fields, inherited from
> >>>>> FullBox. For some reason, both flags were being added manually in
> >>>>> movenc. This patch fixes the issue.
> >>>>>
> >>>>> Signed-off-by: Alessandro Ros <aler9.dev@gmail.com>
> >>>>> ---
> >>>>> libavformat/movenc.c | 3 ---
> >>>>> libavformat/vpcc.c | 2 ++
> >>>>> 2 files changed, 2 insertions(+), 3 deletions(-)
> >>>>>
> >>>>> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> >>>>> index 7ef6cef46a..696ae5a6c9 100644
> >>>>> --- a/libavformat/movenc.c
> >>>>> +++ b/libavformat/movenc.c
> >>>>> @@ -1441,10 +1441,7 @@ static int mov_write_vpcc_tag(AVFormatContext
> >> *s,
> >>>> AVIOContext *pb, MOVTrack *tra
> >>>>>
> >>>>> avio_wb32(pb, 0);
> >>>>> ffio_wfourcc(pb, "vpcC");
> >>>>> - avio_w8(pb, 1); /* version */
> >>>>> - avio_wb24(pb, 0); /* flags */
> >>>>> ff_isom_write_vpcc(s, pb, track->vos_data, track->vos_len,
> >>>> track->par);
> >>>>> -
> >>>>> return update_size(pb, pos);
> >>>>> }
> >>>>>
> >>>>> diff --git a/libavformat/vpcc.c b/libavformat/vpcc.c
> >>>>> index ea66959abf..256407dd6d 100644
> >>>>> --- a/libavformat/vpcc.c
> >>>>> +++ b/libavformat/vpcc.c
> >>>>> @@ -208,6 +208,8 @@ int ff_isom_write_vpcc(AVFormatContext *s,
> >>>> AVIOContext *pb,
> >>>>> if (ret < 0)
> >>>>> return ret;
> >>>>>
> >>>>> + avio_w8(pb, 1); /* version */
> >>>>> + avio_wb24(pb, 0); /* flags */
> >>>>> avio_w8(pb, vpcc.profile);
> >>>>> avio_w8(pb, vpcc.level);
> >>>>> avio_w8(pb, (vpcc.bitdepth << 4) | (vpcc.chroma_subsampling <<
> >> 1)
> >>>> | vpcc.full_range_flag);
>
> Will apply soon unless someone objects.
No objects, and lgtm.
Thanks
Steven
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2] avformat/vpcc: fix VP9 metadata in FLV and RTMP
2023-09-03 16:45 ` aler9
@ 2023-09-03 18:49 ` James Almer
2023-09-04 6:24 ` Steven Liu
0 siblings, 1 reply; 8+ messages in thread
From: James Almer @ 2023-09-03 18:49 UTC (permalink / raw)
To: ffmpeg-devel
On 9/3/2023 1:45 PM, aler9 wrote:
> I looked again at your previous comment and you suggested to explicitly
> mention that this patch will affect FLV too, which i did in the title.
>
> I didn't see any request to change the code. Do you have any suggestion
> regarding the code?
I see the change in the commit message that i had missed, so nevermind.
>
>
>
> Il giorno dom 3 set 2023 alle ore 18:17 James Almer <jamrial@gmail.com> ha
> scritto:
>
>> On 9/3/2023 1:15 PM, aler9 wrote:
>>> sorry, to git add what?
>>
>> You say you integrated my comment, but the contents of the patch are
>> exactly the same.
>>
>>>
>>> Il giorno dom 3 set 2023 alle ore 18:02 James Almer <jamrial@gmail.com>
>> ha
>>> scritto:
>>>
>>>> On 9/3/2023 1:00 PM, Alessandro Ros wrote:
>>>>> I integrated James A. comment and fixed patch format.
>>>>
>>>> I think you forgot to git add.
>>>>
>>>>>
>>>>> In order to send VP9 tracks with FLV or RTMP, the enhanced RTMP
>>>>> specification tells that VPCodecConfigurationRecord, a.k.a. vpcC
>>>>> ISO-BMFF box, must be inserted into a metadata message. However, the
>>>>> function responsible for generating vpcCs currently returns invalid
>>>>> boxes, that are lacking the Version and Flag fields, inherited from
>>>>> FullBox. For some reason, both flags were being added manually in
>>>>> movenc. This patch fixes the issue.
>>>>>
>>>>> Signed-off-by: Alessandro Ros <aler9.dev@gmail.com>
>>>>> ---
>>>>> libavformat/movenc.c | 3 ---
>>>>> libavformat/vpcc.c | 2 ++
>>>>> 2 files changed, 2 insertions(+), 3 deletions(-)
>>>>>
>>>>> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
>>>>> index 7ef6cef46a..696ae5a6c9 100644
>>>>> --- a/libavformat/movenc.c
>>>>> +++ b/libavformat/movenc.c
>>>>> @@ -1441,10 +1441,7 @@ static int mov_write_vpcc_tag(AVFormatContext
>> *s,
>>>> AVIOContext *pb, MOVTrack *tra
>>>>>
>>>>> avio_wb32(pb, 0);
>>>>> ffio_wfourcc(pb, "vpcC");
>>>>> - avio_w8(pb, 1); /* version */
>>>>> - avio_wb24(pb, 0); /* flags */
>>>>> ff_isom_write_vpcc(s, pb, track->vos_data, track->vos_len,
>>>> track->par);
>>>>> -
>>>>> return update_size(pb, pos);
>>>>> }
>>>>>
>>>>> diff --git a/libavformat/vpcc.c b/libavformat/vpcc.c
>>>>> index ea66959abf..256407dd6d 100644
>>>>> --- a/libavformat/vpcc.c
>>>>> +++ b/libavformat/vpcc.c
>>>>> @@ -208,6 +208,8 @@ int ff_isom_write_vpcc(AVFormatContext *s,
>>>> AVIOContext *pb,
>>>>> if (ret < 0)
>>>>> return ret;
>>>>>
>>>>> + avio_w8(pb, 1); /* version */
>>>>> + avio_wb24(pb, 0); /* flags */
>>>>> avio_w8(pb, vpcc.profile);
>>>>> avio_w8(pb, vpcc.level);
>>>>> avio_w8(pb, (vpcc.bitdepth << 4) | (vpcc.chroma_subsampling <<
>> 1)
>>>> | vpcc.full_range_flag);
Will apply soon unless someone objects.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2] avformat/vpcc: fix VP9 metadata in FLV and RTMP
2023-09-03 16:17 ` James Almer
@ 2023-09-03 16:45 ` aler9
2023-09-03 18:49 ` James Almer
0 siblings, 1 reply; 8+ messages in thread
From: aler9 @ 2023-09-03 16:45 UTC (permalink / raw)
To: FFmpeg development discussions and patches
I looked again at your previous comment and you suggested to explicitly
mention that this patch will affect FLV too, which i did in the title.
I didn't see any request to change the code. Do you have any suggestion
regarding the code?
Il giorno dom 3 set 2023 alle ore 18:17 James Almer <jamrial@gmail.com> ha
scritto:
> On 9/3/2023 1:15 PM, aler9 wrote:
> > sorry, to git add what?
>
> You say you integrated my comment, but the contents of the patch are
> exactly the same.
>
> >
> > Il giorno dom 3 set 2023 alle ore 18:02 James Almer <jamrial@gmail.com>
> ha
> > scritto:
> >
> >> On 9/3/2023 1:00 PM, Alessandro Ros wrote:
> >>> I integrated James A. comment and fixed patch format.
> >>
> >> I think you forgot to git add.
> >>
> >>>
> >>> In order to send VP9 tracks with FLV or RTMP, the enhanced RTMP
> >>> specification tells that VPCodecConfigurationRecord, a.k.a. vpcC
> >>> ISO-BMFF box, must be inserted into a metadata message. However, the
> >>> function responsible for generating vpcCs currently returns invalid
> >>> boxes, that are lacking the Version and Flag fields, inherited from
> >>> FullBox. For some reason, both flags were being added manually in
> >>> movenc. This patch fixes the issue.
> >>>
> >>> Signed-off-by: Alessandro Ros <aler9.dev@gmail.com>
> >>> ---
> >>> libavformat/movenc.c | 3 ---
> >>> libavformat/vpcc.c | 2 ++
> >>> 2 files changed, 2 insertions(+), 3 deletions(-)
> >>>
> >>> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> >>> index 7ef6cef46a..696ae5a6c9 100644
> >>> --- a/libavformat/movenc.c
> >>> +++ b/libavformat/movenc.c
> >>> @@ -1441,10 +1441,7 @@ static int mov_write_vpcc_tag(AVFormatContext
> *s,
> >> AVIOContext *pb, MOVTrack *tra
> >>>
> >>> avio_wb32(pb, 0);
> >>> ffio_wfourcc(pb, "vpcC");
> >>> - avio_w8(pb, 1); /* version */
> >>> - avio_wb24(pb, 0); /* flags */
> >>> ff_isom_write_vpcc(s, pb, track->vos_data, track->vos_len,
> >> track->par);
> >>> -
> >>> return update_size(pb, pos);
> >>> }
> >>>
> >>> diff --git a/libavformat/vpcc.c b/libavformat/vpcc.c
> >>> index ea66959abf..256407dd6d 100644
> >>> --- a/libavformat/vpcc.c
> >>> +++ b/libavformat/vpcc.c
> >>> @@ -208,6 +208,8 @@ int ff_isom_write_vpcc(AVFormatContext *s,
> >> AVIOContext *pb,
> >>> if (ret < 0)
> >>> return ret;
> >>>
> >>> + avio_w8(pb, 1); /* version */
> >>> + avio_wb24(pb, 0); /* flags */
> >>> avio_w8(pb, vpcc.profile);
> >>> avio_w8(pb, vpcc.level);
> >>> avio_w8(pb, (vpcc.bitdepth << 4) | (vpcc.chroma_subsampling <<
> 1)
> >> | vpcc.full_range_flag);
> >> _______________________________________________
> >> ffmpeg-devel mailing list
> >> ffmpeg-devel@ffmpeg.org
> >> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >>
> >> To unsubscribe, visit link above, or email
> >> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> >>
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2] avformat/vpcc: fix VP9 metadata in FLV and RTMP
2023-09-03 16:15 ` aler9
@ 2023-09-03 16:17 ` James Almer
2023-09-03 16:45 ` aler9
0 siblings, 1 reply; 8+ messages in thread
From: James Almer @ 2023-09-03 16:17 UTC (permalink / raw)
To: ffmpeg-devel
On 9/3/2023 1:15 PM, aler9 wrote:
> sorry, to git add what?
You say you integrated my comment, but the contents of the patch are
exactly the same.
>
> Il giorno dom 3 set 2023 alle ore 18:02 James Almer <jamrial@gmail.com> ha
> scritto:
>
>> On 9/3/2023 1:00 PM, Alessandro Ros wrote:
>>> I integrated James A. comment and fixed patch format.
>>
>> I think you forgot to git add.
>>
>>>
>>> In order to send VP9 tracks with FLV or RTMP, the enhanced RTMP
>>> specification tells that VPCodecConfigurationRecord, a.k.a. vpcC
>>> ISO-BMFF box, must be inserted into a metadata message. However, the
>>> function responsible for generating vpcCs currently returns invalid
>>> boxes, that are lacking the Version and Flag fields, inherited from
>>> FullBox. For some reason, both flags were being added manually in
>>> movenc. This patch fixes the issue.
>>>
>>> Signed-off-by: Alessandro Ros <aler9.dev@gmail.com>
>>> ---
>>> libavformat/movenc.c | 3 ---
>>> libavformat/vpcc.c | 2 ++
>>> 2 files changed, 2 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
>>> index 7ef6cef46a..696ae5a6c9 100644
>>> --- a/libavformat/movenc.c
>>> +++ b/libavformat/movenc.c
>>> @@ -1441,10 +1441,7 @@ static int mov_write_vpcc_tag(AVFormatContext *s,
>> AVIOContext *pb, MOVTrack *tra
>>>
>>> avio_wb32(pb, 0);
>>> ffio_wfourcc(pb, "vpcC");
>>> - avio_w8(pb, 1); /* version */
>>> - avio_wb24(pb, 0); /* flags */
>>> ff_isom_write_vpcc(s, pb, track->vos_data, track->vos_len,
>> track->par);
>>> -
>>> return update_size(pb, pos);
>>> }
>>>
>>> diff --git a/libavformat/vpcc.c b/libavformat/vpcc.c
>>> index ea66959abf..256407dd6d 100644
>>> --- a/libavformat/vpcc.c
>>> +++ b/libavformat/vpcc.c
>>> @@ -208,6 +208,8 @@ int ff_isom_write_vpcc(AVFormatContext *s,
>> AVIOContext *pb,
>>> if (ret < 0)
>>> return ret;
>>>
>>> + avio_w8(pb, 1); /* version */
>>> + avio_wb24(pb, 0); /* flags */
>>> avio_w8(pb, vpcc.profile);
>>> avio_w8(pb, vpcc.level);
>>> avio_w8(pb, (vpcc.bitdepth << 4) | (vpcc.chroma_subsampling << 1)
>> | vpcc.full_range_flag);
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>> To unsubscribe, visit link above, or email
>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2] avformat/vpcc: fix VP9 metadata in FLV and RTMP
2023-09-03 16:01 ` James Almer
@ 2023-09-03 16:15 ` aler9
2023-09-03 16:17 ` James Almer
0 siblings, 1 reply; 8+ messages in thread
From: aler9 @ 2023-09-03 16:15 UTC (permalink / raw)
To: FFmpeg development discussions and patches
sorry, to git add what?
Il giorno dom 3 set 2023 alle ore 18:02 James Almer <jamrial@gmail.com> ha
scritto:
> On 9/3/2023 1:00 PM, Alessandro Ros wrote:
> > I integrated James A. comment and fixed patch format.
>
> I think you forgot to git add.
>
> >
> > In order to send VP9 tracks with FLV or RTMP, the enhanced RTMP
> > specification tells that VPCodecConfigurationRecord, a.k.a. vpcC
> > ISO-BMFF box, must be inserted into a metadata message. However, the
> > function responsible for generating vpcCs currently returns invalid
> > boxes, that are lacking the Version and Flag fields, inherited from
> > FullBox. For some reason, both flags were being added manually in
> > movenc. This patch fixes the issue.
> >
> > Signed-off-by: Alessandro Ros <aler9.dev@gmail.com>
> > ---
> > libavformat/movenc.c | 3 ---
> > libavformat/vpcc.c | 2 ++
> > 2 files changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> > index 7ef6cef46a..696ae5a6c9 100644
> > --- a/libavformat/movenc.c
> > +++ b/libavformat/movenc.c
> > @@ -1441,10 +1441,7 @@ static int mov_write_vpcc_tag(AVFormatContext *s,
> AVIOContext *pb, MOVTrack *tra
> >
> > avio_wb32(pb, 0);
> > ffio_wfourcc(pb, "vpcC");
> > - avio_w8(pb, 1); /* version */
> > - avio_wb24(pb, 0); /* flags */
> > ff_isom_write_vpcc(s, pb, track->vos_data, track->vos_len,
> track->par);
> > -
> > return update_size(pb, pos);
> > }
> >
> > diff --git a/libavformat/vpcc.c b/libavformat/vpcc.c
> > index ea66959abf..256407dd6d 100644
> > --- a/libavformat/vpcc.c
> > +++ b/libavformat/vpcc.c
> > @@ -208,6 +208,8 @@ int ff_isom_write_vpcc(AVFormatContext *s,
> AVIOContext *pb,
> > if (ret < 0)
> > return ret;
> >
> > + avio_w8(pb, 1); /* version */
> > + avio_wb24(pb, 0); /* flags */
> > avio_w8(pb, vpcc.profile);
> > avio_w8(pb, vpcc.level);
> > avio_w8(pb, (vpcc.bitdepth << 4) | (vpcc.chroma_subsampling << 1)
> | vpcc.full_range_flag);
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2] avformat/vpcc: fix VP9 metadata in FLV and RTMP
2023-09-03 16:00 Alessandro Ros
@ 2023-09-03 16:01 ` James Almer
2023-09-03 16:15 ` aler9
0 siblings, 1 reply; 8+ messages in thread
From: James Almer @ 2023-09-03 16:01 UTC (permalink / raw)
To: ffmpeg-devel
On 9/3/2023 1:00 PM, Alessandro Ros wrote:
> I integrated James A. comment and fixed patch format.
I think you forgot to git add.
>
> In order to send VP9 tracks with FLV or RTMP, the enhanced RTMP
> specification tells that VPCodecConfigurationRecord, a.k.a. vpcC
> ISO-BMFF box, must be inserted into a metadata message. However, the
> function responsible for generating vpcCs currently returns invalid
> boxes, that are lacking the Version and Flag fields, inherited from
> FullBox. For some reason, both flags were being added manually in
> movenc. This patch fixes the issue.
>
> Signed-off-by: Alessandro Ros <aler9.dev@gmail.com>
> ---
> libavformat/movenc.c | 3 ---
> libavformat/vpcc.c | 2 ++
> 2 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index 7ef6cef46a..696ae5a6c9 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -1441,10 +1441,7 @@ static int mov_write_vpcc_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *tra
>
> avio_wb32(pb, 0);
> ffio_wfourcc(pb, "vpcC");
> - avio_w8(pb, 1); /* version */
> - avio_wb24(pb, 0); /* flags */
> ff_isom_write_vpcc(s, pb, track->vos_data, track->vos_len, track->par);
> -
> return update_size(pb, pos);
> }
>
> diff --git a/libavformat/vpcc.c b/libavformat/vpcc.c
> index ea66959abf..256407dd6d 100644
> --- a/libavformat/vpcc.c
> +++ b/libavformat/vpcc.c
> @@ -208,6 +208,8 @@ int ff_isom_write_vpcc(AVFormatContext *s, AVIOContext *pb,
> if (ret < 0)
> return ret;
>
> + avio_w8(pb, 1); /* version */
> + avio_wb24(pb, 0); /* flags */
> avio_w8(pb, vpcc.profile);
> avio_w8(pb, vpcc.level);
> avio_w8(pb, (vpcc.bitdepth << 4) | (vpcc.chroma_subsampling << 1) | vpcc.full_range_flag);
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* [FFmpeg-devel] [PATCH v2] avformat/vpcc: fix VP9 metadata in FLV and RTMP
@ 2023-09-03 16:00 Alessandro Ros
2023-09-03 16:01 ` James Almer
0 siblings, 1 reply; 8+ messages in thread
From: Alessandro Ros @ 2023-09-03 16:00 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Alessandro Ros
I integrated James A. comment and fixed patch format.
In order to send VP9 tracks with FLV or RTMP, the enhanced RTMP
specification tells that VPCodecConfigurationRecord, a.k.a. vpcC
ISO-BMFF box, must be inserted into a metadata message. However, the
function responsible for generating vpcCs currently returns invalid
boxes, that are lacking the Version and Flag fields, inherited from
FullBox. For some reason, both flags were being added manually in
movenc. This patch fixes the issue.
Signed-off-by: Alessandro Ros <aler9.dev@gmail.com>
---
libavformat/movenc.c | 3 ---
libavformat/vpcc.c | 2 ++
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 7ef6cef46a..696ae5a6c9 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1441,10 +1441,7 @@ static int mov_write_vpcc_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *tra
avio_wb32(pb, 0);
ffio_wfourcc(pb, "vpcC");
- avio_w8(pb, 1); /* version */
- avio_wb24(pb, 0); /* flags */
ff_isom_write_vpcc(s, pb, track->vos_data, track->vos_len, track->par);
-
return update_size(pb, pos);
}
diff --git a/libavformat/vpcc.c b/libavformat/vpcc.c
index ea66959abf..256407dd6d 100644
--- a/libavformat/vpcc.c
+++ b/libavformat/vpcc.c
@@ -208,6 +208,8 @@ int ff_isom_write_vpcc(AVFormatContext *s, AVIOContext *pb,
if (ret < 0)
return ret;
+ avio_w8(pb, 1); /* version */
+ avio_wb24(pb, 0); /* flags */
avio_w8(pb, vpcc.profile);
avio_w8(pb, vpcc.level);
avio_w8(pb, (vpcc.bitdepth << 4) | (vpcc.chroma_subsampling << 1) | vpcc.full_range_flag);
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-09-04 6:24 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-03 16:08 [FFmpeg-devel] [PATCH v2] avformat/vpcc: fix VP9 metadata in FLV and RTMP Alessandro Ros
-- strict thread matches above, loose matches on Subject: below --
2023-09-03 16:00 Alessandro Ros
2023-09-03 16:01 ` James Almer
2023-09-03 16:15 ` aler9
2023-09-03 16:17 ` James Almer
2023-09-03 16:45 ` aler9
2023-09-03 18:49 ` James Almer
2023-09-04 6:24 ` Steven Liu
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git