[FFmpeg-devel] [PATCH] MAINTAINERS: add a separate list for those with push access

2022-12-14 Thread Lynne
This list is incomplete, and just contains those I could see
while looking at the recent git log. If it looks like I've forgotten you, I 
definitely haven't!
We may complete the list at a later date.

This makes it such that those who add themselves to MAINTAINERS do not
get push access by default, but rather, they have to request it
explicitly in a different commit. This used to be the situation
before it was changed at the start of this year and is pretty much what
everyone expects.

Patch attached.

>From 5c353412a25fd46c5077e5cf92ddfd6532eb46cb Mon Sep 17 00:00:00 2001
From: Lynne 
Date: Thu, 15 Dec 2022 02:05:00 +0100
Subject: [PATCH] MAINTAINERS: add a separate list for those with push access

This list is incomplete, and just contains those I could remember
while looking at the recent git log.
We may complete the list at a later date.

This makes it such that those who add themselves to MAINTAINERS do not
get push access by default, but rather, they have to request it
explicitly in a different commit. This used to be the situation
before it was changed at the start of this year.
---
 MAINTAINERS | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 48e2ec4fd4..f03327702a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -552,6 +552,21 @@ ADI/Blackfin DSPMarc Hoffman
 Sparc   Roman Shaposhnik
 OS/2KO Myung-Hun
 
+Developers with git write access
+
+Paul B Mahol
+Michael Niedermayer
+James Almer
+Lynne
+Martin Storsjo
+Hendrik Leppkes
+Philip Langdale
+Clément Bœsch
+Niklas Haas
+Timo Rothenpieler
+Andreas Rheinhardt
+Ronald Bultje
+(this list is incomplete)
 
 Developers with git write access who are currently not maintaining any specific part
 
-- 
2.38.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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v14 9/9] avcodec/evc: Changes in Changelog and MAINTAINERS files

2022-12-14 Thread Lynne
Dec 14, 2022, 22:45 by mich...@niedermayer.cc:

> On Tue, Dec 13, 2022 at 07:42:23PM +0100, Lynne wrote:
>
>> Dec 13, 2022, 13:22 by d.kozin...@samsung.com:
>>
>> > We made some changes in our EVC wrapper implementation and would like to
>> > submit new patches to patchwork, but it's still unclear to me how to deal
>> > with the MAINTAINERS file. 
>> >
>> > Should I leave the following lines:
>> > +  libxevd.c Dawid Kozinski
>> > +  libxeve.c,Dawid Kozinski
>> > +  evc.c, evc.hDawid Kozinski
>> > +  evcdec.c Dawid Kozinski
>> > +  evc_parser.c  Dawid Kozinski
>> >
>> > or should I remove them?
>> >
>> > We are expecting a clear and consistent standpoint on this matter.
>> >
>>
>> Get rid of them. Michael has made it clear anyone on the list
>> must have commit rights. I'm not for blocking anyone from having
>> commit rights, but you've made zero contributions to the project
>> so far, and maintaining requires some level of dedication.
>>
>
> You surely have the right to object to Dawid having commit rights.
> And i understand your argument why, but that has nothing to do with
> me or the list. There are people on the MAINTAINERS list who do not
> have commit rights.
> for example the developers who i presume are paid by loongson to maintain 
> the mips/loongson code do not currently have commit right.
> Seems a similar case to me
>

You're making assumptions. You've said that anyone who's on maintainers
needs push rights. Then you said that unless someone explicitly asks not to
get push rights, they will if they're added to maintainers. Right now, the
person hasn't said anything, yet you're assuming he doesn't want push rights.

I've sent a patch to list maintainers with push access. Those who'd like
push access will have to explicitly request it in a different commit.
If that patch is accepted, I have no problem with this patch.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v2] avcodec/libdav1d: honor the requested skip_frame level

2022-12-14 Thread James Almer
This allows dropping non-reference, non-intra, or non-key frames on supported
libdav1d versions.

Signed-off-by: James Almer 
---
 libavcodec/libdav1d.c | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index 2f151d2d1b..5a4daa3e23 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -260,6 +260,20 @@ static av_cold int libdav1d_init(AVCodecContext *c)
s.n_frame_threads, s.n_tile_threads);
 #endif
 
+#if FF_DAV1D_VERSION_AT_LEAST(6,8)
+switch (c->skip_frame) {
+case AVDISCARD_NONREF:
+s.decode_frame_type = DAV1D_DECODEFRAMETYPE_REFERENCE;
+break;
+case AVDISCARD_NONINTRA:
+s.decode_frame_type = DAV1D_DECODEFRAMETYPE_INTRA;
+break;
+case AVDISCARD_NONKEY:
+s.decode_frame_type = DAV1D_DECODEFRAMETYPE_KEY;
+break;
+}
+#endif
+
 res = libdav1d_parse_extradata(c);
 if (res < 0)
 return res;
-- 
2.38.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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [REFUND-REQUEST] Travel to Developer Meeting

2022-12-14 Thread Stefano Sabatini
On Wed, Dec 14, 2022 at 3:06 PM Derek Buitenhuis
 wrote:
>
> Hello,
>
> I travelled to Barcelona for the developer meeting.
>
> I am only requesting for my flight, as I chose to stay in non-VideoLAN hotel.
>
> Flight: £111.98 - receipt available, of course.
>
> As I am not super active currently, understandable if I cannot put this 
> through SPI.

Approved on my side, pending Michael's approval.

Please follow these instructions to prepare and send the reimbursement form:
https://www.spi-inc.org/treasurer/reimbursement-form/

and put me and Michael in CC:

Let me know in private if you have issues with the paperwork.

Thanks, best regards, Stefano.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [REFUND-REQUEST]Travel cost reimbursement request

2022-12-14 Thread Stefano Sabatini
On Tue, Dec 13, 2022 at 8:09 PM Carl Eugen Hoyos  wrote:
>
> Hi!
>
> I traveled to Barcelona for the development meeting and request a 
> reimbursement:
> Flight Vienna - Barcelona - Vienna: 449,99
> Two nights in a hotel in Barcelona: 161,06
> Bus to Barcelona center: 5,90
>
> Thank you, Carl Eugen

Approved on my side, pending Michael's approval.

Please follow these instructions to prepare and send the reimbursement form:
https://www.spi-inc.org/treasurer/reimbursement-form/

and put me and Michael in CC:

Let me know in private if you have issues with the paperwork.

Thanks, best regards, Stefano.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v2 2/2] avformat/mov: re-allow zero sample sizes if that is not the default

2022-12-14 Thread Marton Balint




On Mon, 12 Dec 2022, Chris Ribble wrote:


On Sun, Dec 11, 2022 at 2:34 PM Chris Ribble  wrote:


This looks great and I've confirmed it fixes the issue. I see the
warning on STDERR about ignoring the trun box: "Ignoring trun box with
zero sized samples", which is great.



Actually, this introduces a new issue when I try to transcode the
problematic mp4 and then segment it with the DASH muxer.

It appears that ignoring the trun box while reading the input affects
the segment alignment of the audio with the video.The durations jitter
around quite a bit and some of them are very long. The same problem
seems to exist whether I transcode or copy the audio.


Well, remuxing sparse audio packets certainly can cause issues. For a full 
transcode, I did not expect that much difference, for the audio gaps you 
should be able to generate silence with -af aresample=async=1 or similar.


Overall, I am not sure what to do here:

1) Simply revert original patch, and make it work same as before, and
   accept that 0-sized packets can be generated by the MOV demuxer, or
   fuzzed files can cause practically infinite loops (not that unusual for
   multimedia formats)

2) Apply this patchset which makes the MOV demuxer ignore the 0-sized
   packets and fixes the original fuzzing issue, but causing some strange
   issues when remuxing or transcoding because the audio packets become
   sparse.

3) Dig deeper what goes wrong with remuxing/reencoding with sparse audio.
   Unfortunately I won't have time to do this.

Comments are welcome.

Thanks,
Marton

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v14 9/9] avcodec/evc: Changes in Changelog and MAINTAINERS files

2022-12-14 Thread Michael Niedermayer
On Tue, Dec 13, 2022 at 07:42:23PM +0100, Lynne wrote:
> Dec 13, 2022, 13:22 by d.kozin...@samsung.com:
> 
> > We made some changes in our EVC wrapper implementation and would like to
> > submit new patches to patchwork, but it's still unclear to me how to deal
> > with the MAINTAINERS file. 
> >
> > Should I leave the following lines:
> > +  libxevd.c Dawid Kozinski
> > +  libxeve.c,Dawid Kozinski
> > +  evc.c, evc.hDawid Kozinski
> > +  evcdec.c Dawid Kozinski
> > +  evc_parser.c  Dawid Kozinski
> >
> > or should I remove them?
> >
> > We are expecting a clear and consistent standpoint on this matter.
> >
> 
> Get rid of them. Michael has made it clear anyone on the list
> must have commit rights. I'm not for blocking anyone from having
> commit rights, but you've made zero contributions to the project
> so far, and maintaining requires some level of dedication.

You surely have the right to object to Dawid having commit rights.
And i understand your argument why, but that has nothing to do with
me or the list. There are people on the MAINTAINERS list who do not
have commit rights.
for example the developers who i presume are paid by loongson to maintain 
the mips/loongson code do not currently have commit right.
Seems a similar case to me

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 1
"Used only once"- "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v14 9/9] avcodec/evc: Changes in Changelog and MAINTAINERS files

2022-12-14 Thread Michael Niedermayer
On Tue, Dec 13, 2022 at 08:33:29AM -0500, Ronald S. Bultje wrote:
> Hi David,
> 
> On Tue, Dec 13, 2022 at 7:22 AM Dawid Kozinski/Multimedia (PLT)
> /SRPOL/Staff Engineer/Samsung Electronics  wrote:
> 
> > Should I leave the following lines:
> > +  libxevd.c Dawid Kozinski
> > +  libxeve.c,Dawid Kozinski
> > +  evc.c, evc.hDawid Kozinski
> > +  evcdec.c Dawid Kozinski
> > +  evc_parser.c  Dawid Kozinski
> >
> > or should I remove them?
> >
> 
> Here's a question for you, and the answer probably becomes self-evident
> from that. If you, Dawid, stop working for Samsung, for example because
> you're starting your own business or Samsung fires you or Google hires you,
> or if Samsung stops sponsoring this new codec called "EVC" or stops
> contributing to this new library "libxeve". Will you, Dawid, still maintain
> these files?
> 
> If the answer is yes, then you can shorten these lines ("evc*.[ch]: Dawid"
> & "livxev[ed].c: Dawid") and keep them.
> 
> If the answer is no, then I think you should remove (or adjust) these
> lines, since they are (in their current form) inaccurate: you are not
> maintaining these files, your company is.
> 

I think for code maintained by a company we still should list a person
because persons can be contacted while large companies are sometimes very
difficult to contact.
maybe
Dawid Kozinski (Samsung) or Samsung (Dawid Kozinski)
or something like that would specify this better

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

"I am not trying to be anyone's saviour, I'm trying to think about the
 future and not be sad" - Elon Musk



signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avcodec/pnm: avoid mirroring PFM images vertically

2022-12-14 Thread Leo Izen

On 11/29/22 06:14, Anton Khirnov wrote:

Quoting Leo Izen (2022-11-16 12:43:06)

PFM (aka Portable FloatMap) encodes its scanlines from bottom-to-top,
not from top-to-bottom, unlike other NetPBM formats. Without this
patch, FFmpeg ignores this exception and decodes/encodes PFM images
mirrored vertically from their proper orientation.

For reference, see the NetPBM tool pfmtopam, which encodes a .pam
from a .pfm, using the correct orientation (and which FFmpeg reads
correctly). Also compare ffplay to magick display, which shows the
correct orientation as well.

See: http://www.pauldebevec.com/Research/HDR/PFM/ and see:
https://netpbm.sourceforge.net/doc/pfm.html for descriptions of this
image format.

Signed-off-by: Leo Izen 
---
  libavcodec/pnmdec.c  | 10 ++
  libavcodec/pnmenc.c  | 18 ++
  tests/ref/lavf/gbrpf32be.pfm |  2 +-
  tests/ref/lavf/gbrpf32le.pfm |  2 +-
  tests/ref/lavf/grayf32be.pfm |  2 +-
  tests/ref/lavf/grayf32le.pfm |  2 +-
  6 files changed, 24 insertions(+), 12 deletions(-)


Looks reasonable, will push soonish.



I got a LGTM, can someone push this? Thanks.

- Leo Izen (thebombzen)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [REFUND-REQUEST] Travel to Developer Meeting

2022-12-14 Thread Thilo Borgmann

Am 14.12.22 um 15:06 schrieb Derek Buitenhuis:

Hello,

I travelled to Barcelona for the developer meeting.

I am only requesting for my flight, as I chose to stay in non-VideoLAN hotel.

Flight: £111.98 - receipt available, of course.

As I am not super active currently, understandable if I cannot put this through 
SPI.


I'm in favor to reimburse you regardless (of what you feel as I see many mails 
from you).

-Thilo
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] configure: Change _cflags_noopt for MSVC to -Od

2022-12-14 Thread Thomson Tan
With this configuration (WSL2+MSVC) for this diff, I ran `make fate-rsync
SAMPLES=fate-suite && make fate SAMPLES=fate-suite/` which passed locally.
I also checked the binaries (ffmpeg.exe) and made sure the previous inlined
functions are not inlined here.

On Mon, Dec 12, 2022 at 1:13 PM Carl Eugen Hoyos  wrote:

> Am Mo., 12. Dez. 2022 um 22:02 Uhr schrieb Thomson Tan  >:
> >
> > I built the latest FFmpeg with WSL2+MSVC on Windows. Tried configure
> > with --disable-optimizations, but still got an optimized build which
> makes
> > it hard to set breakpoint on hot functions (likely inlined).
>
> Of course, this explains why you wrote the patch.
> But I still wonder how you tested it.
>
> Please find out what top-posting means and avoid it here, Carl Eugen
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v3 3/7] avcodec/mediacodecenc: use bsf to handle crop

2022-12-14 Thread Zhao Zhili
On Thu, 2022-12-15 at 01:37 +0800, Zhao Zhili wrote:
> On Wed, 2022-12-14 at 18:08 +0100, Tomas Härdin wrote:
> > tis 2022-12-13 klockan 11:20 +0800 skrev zhilizhao(赵志立):
> > > > On Dec 12, 2022, at 23:27, Tomas Härdin  wrote:
> > > > 
> > > > lör 2022-12-10 klockan 01:22 +0800 skrev Zhao Zhili:
> > > > > From: Zhao Zhili 
> > > > > 
> > > > > It's well known that mediacodec encoder requires 16x16
> > > > > alignment.
> > > > > Use our bsf to fix the crop info.
> > > > > ---
> > > > > v3: don't change the dimension for AV_PIX_FMT_MEDIACODEC. It
> > > > > can
> > > > > have
> > > > > side effect.
> > > > 
> > > > Looks like this silently crops? Is that really a good idea? We
> > > > usually
> > > > don't do stuff like that. For example codecs that require even
> > > > dimensions complain loudly then fail.
> > > 
> > > It’s reasonable to require even dimensions. Require dimensions
> > > aligned
> > > to 16 is uncommon. Everyone will complain why 1080x1920 doesn’t
> > > work.
> > > 
> > > A lot of apps just use aligned dimensions. Users have no control
> > > on
> > > these apps. It’s not the same with FFmpeg, users (developer or
> > > not)
> > > can specify the dimension directly.
> > 
> > Wait a sec, I think I was misunderstanding what the code is doing.
> > FFALIGN rounds *up*. Does this mean you insert fake data in the
> > border
> > that then gets cropped away, meaning the original essence is still
> > "there"? That's a different thing and probably perfectly OK.
> 
> Yes, the dimension passed to MC is rounding up, then use bsf to
> remove
> that border. It depends on our AVFrame data has been aligned
> properly.

Actually there's no such dependent.

> This job is supposed to be done by any decent encoder, not by a
> wrapper.
> 
> > I think we might want something for this inside lavf somewhere, so
> > that
> > encoders can signal dimension alignment requirements. Some
> > containers
> > (MXF, MOV) support such cropping in a codec-agnostic manner.
> 
> From my own experience, dimension mismatch between codec and
> container
> makes a lot of trouble. ISO base format specification specified how
> to
> crop/scale after decoding clear, however, I don't think it has been
> widely supported, including FFmpeg. We can fix that inside of FFmpeg,
> but we should avoid such cases as much as we can.
> 
> > > If we don’t fix it, either:
> > > 
> > > 1. Reject and fail directly. User complain why.
> > > 2. Accept and keep going. Sometimes it works, sometimes don’t. It
> > > depends on the device and get into a confused situation.
> > > 
> > > I know there are getWidthAlignment()/getHeightAlignment() to get
> > > alignment info of codecs. The results are unreliable. The only
> > > reliable way I can find is don’t depends on those API and fix it
> > > by ourself.
> > 
> > Given how temperamental MC seems to be a "belt and braces" approach
> > might be appropriate when dealing with it. Tell users (ffmpeg.c is
> > a
> > user here) that dimensions must be aligned by 16x16 and then
> > automagically doing the required padding and cropping somewhere
> > (lavf
> > or ffmpeg.c) feels like a decent solution.
> > 
> > /Tomas
> > 
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> > 
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-requ...@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-requ...@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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 2/2] avcodec/jpeg2000dec: Add support for HTJ2K decoding.

2022-12-14 Thread Tomas Härdin
mån 2022-12-12 klockan 10:40 -0800 skrev Pierre-Anthony Lemieux:
> 
> I suggest keeping optimizations as a second step, and instead
> focusing
> on accuracy of decoding so that we end-up with a good baseline.

I didn't check this yet since I'm busy with other projects, but if what
Caleb told me about this decoding the official references is right then
it should be OK. I checked with these references before and discovered
a decoding bug that Caleb fixed.

/Tomas

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v3 3/7] avcodec/mediacodecenc: use bsf to handle crop

2022-12-14 Thread Zhao Zhili
On Wed, 2022-12-14 at 18:08 +0100, Tomas Härdin wrote:
> tis 2022-12-13 klockan 11:20 +0800 skrev zhilizhao(赵志立):
> > 
> > > On Dec 12, 2022, at 23:27, Tomas Härdin  wrote:
> > > 
> > > lör 2022-12-10 klockan 01:22 +0800 skrev Zhao Zhili:
> > > > From: Zhao Zhili 
> > > > 
> > > > It's well known that mediacodec encoder requires 16x16
> > > > alignment.
> > > > Use our bsf to fix the crop info.
> > > > ---
> > > > v3: don't change the dimension for AV_PIX_FMT_MEDIACODEC. It
> > > > can
> > > > have
> > > > side effect.
> > > 
> > > Looks like this silently crops? Is that really a good idea? We
> > > usually
> > > don't do stuff like that. For example codecs that require even
> > > dimensions complain loudly then fail.
> > 
> > It’s reasonable to require even dimensions. Require dimensions
> > aligned
> > to 16 is uncommon. Everyone will complain why 1080x1920 doesn’t
> > work.
> > 
> > A lot of apps just use aligned dimensions. Users have no control on
> > these apps. It’s not the same with FFmpeg, users (developer or not)
> > can specify the dimension directly.
> 
> Wait a sec, I think I was misunderstanding what the code is doing.
> FFALIGN rounds *up*. Does this mean you insert fake data in the
> border
> that then gets cropped away, meaning the original essence is still
> "there"? That's a different thing and probably perfectly OK.

Yes, the dimension passed to MC is rounding up, then use bsf to remove
that border. It depends on our AVFrame data has been aligned properly.
This job is supposed to be done by any decent encoder, not by a
wrapper.

> 
> I think we might want something for this inside lavf somewhere, so
> that
> encoders can signal dimension alignment requirements. Some containers
> (MXF, MOV) support such cropping in a codec-agnostic manner.

From my own experience, dimension mismatch between codec and container
makes a lot of trouble. ISO base format specification specified how to
crop/scale after decoding clear, however, I don't think it has been
widely supported, including FFmpeg. We can fix that inside of FFmpeg,
but we should avoid such cases as much as we can.

> 
> > If we don’t fix it, either:
> > 
> > 1. Reject and fail directly. User complain why.
> > 2. Accept and keep going. Sometimes it works, sometimes don’t. It
> > depends on the device and get into a confused situation.
> > 
> > I know there are getWidthAlignment()/getHeightAlignment() to get
> > alignment info of codecs. The results are unreliable. The only
> > reliable way I can find is don’t depends on those API and fix it
> > by ourself.
> 
> Given how temperamental MC seems to be a "belt and braces" approach
> might be appropriate when dealing with it. Tell users (ffmpeg.c is a
> user here) that dimensions must be aligned by 16x16 and then
> automagically doing the required padding and cropping somewhere (lavf
> or ffmpeg.c) feels like a decent solution.
> 
> /Tomas
> 
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avformat: Rename IPFS to IPFS gateway

2022-12-14 Thread Tomas Härdin
tis 2022-12-13 klockan 12:48 + skrev Derek Buitenhuis:
> On 12/13/2022 12:44 PM, Derek Buitenhuis wrote:
> > I'll push with the internal symbol renames removed later today
> > if nobody objects.
> 
> [...]
> 
> > -const URLProtocol ff_ipfs_protocol = {
> > -    .name   = "ipfs",
> > +const URLProtocol ff_ipfs_gateway_protocol = {
> > +    .name   = "ipfs_gateway",
> 
> Actually, would this break ipfs:// urls? Might need to remove this,
> too.

This is why I objected to this nonsense in the first place. Business
logic doesn't belong in lavf.

/Tomass

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v2 5/7] avcodec/mediacodecenc: remove the strategy to create DTS

2022-12-14 Thread Tomas Härdin
tis 2022-12-13 klockan 10:55 +0800 skrev zhilizhao(赵志立):
> 
> 
> > On Dec 12, 2022, at 23:28, Tomas Härdin  wrote:
> > 
> > ons 2022-12-07 klockan 17:31 +0800 skrev Zhao Zhili:
> > > From: Zhao Zhili 
> > > 
> > > Use input PTS as DTS has multiple problems:
> > > 1. If there is no reordering, it's better to just use the output
> > > PTS as DTS, since encoder may change the timestamp value (do it
> > > on purpose or rounding error).
> > > 
> > > 2. If there is reordering, input PTS should be shift a few frames
> > > as DTS to satisfy the requirement of PTS >= DTS. I can't find a
> > > reliable way to determine how many frames to be shift. For
> > > example,
> > > we don't known if the encoder use hierarchical B frames. The
> > > max_num_reorder_frames can be get from VUI, but VUI is optional.
> > > 
> > > 3. Encoder dropping frames makes the case worse. Android has an
> > > BITRATE_MODE_CBR_FD option to allow it explicitly.
> > 
> > Don't we already have code to parse this stuff from h.264 streams?
> 
> We have code to parse max_num_reorder_frames, if the stream contains
> the field.
> 
> We have some code to generate/guess DTS but doesn’t work reliably for
> H.264/H.265. I guess it’s hard, if not impossible. We don’t know the
> prediction structures. Use encoder’s input PTS as DTS works for some
> transport protocols like RTP, and MP4 with negative_cts_offsets,
> otherwise it’s broken due to PTS >= DTS.

Right, H.264 and H.265 support rather arbitrary reference structures. I
guess a pessimistic estimate is good enough

/Tomas

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v3 3/7] avcodec/mediacodecenc: use bsf to handle crop

2022-12-14 Thread Tomas Härdin
ons 2022-12-14 klockan 18:08 +0100 skrev Tomas Härdin:
> tis 2022-12-13 klockan 11:20 +0800 skrev zhilizhao(赵志立):
> > 
> > 
> > > On Dec 12, 2022, at 23:27, Tomas Härdin  wrote:
> > > 
> > > lör 2022-12-10 klockan 01:22 +0800 skrev Zhao Zhili:
> > > > From: Zhao Zhili 
> > > > 
> > > > It's well known that mediacodec encoder requires 16x16
> > > > alignment.
> > > > Use our bsf to fix the crop info.
> > > > ---
> > > > v3: don't change the dimension for AV_PIX_FMT_MEDIACODEC. It
> > > > can
> > > > have
> > > > side effect.
> > > 
> > > Looks like this silently crops? Is that really a good idea? We
> > > usually
> > > don't do stuff like that. For example codecs that require even
> > > dimensions complain loudly then fail.
> > 
> > It’s reasonable to require even dimensions. Require dimensions
> > aligned
> > to 16 is uncommon. Everyone will complain why 1080x1920 doesn’t
> > work.
> > 
> > A lot of apps just use aligned dimensions. Users have no control on
> > these apps. It’s not the same with FFmpeg, users (developer or not)
> > can specify the dimension directly.
> 
> Wait a sec, I think I was misunderstanding what the code is doing.
> FFALIGN rounds *up*. Does this mean you insert fake data in the
> border
> that then gets cropped away, meaning the original essence is still
> "there"? That's a different thing and probably perfectly OK.
> 
> I think we might want something for this inside lavf somewhere, so
> that
> encoders can signal dimension alignment requirements. Some containers
> (MXF, MOV) support such cropping in a codec-agnostic manner.
> 
> > 
> > If we don’t fix it, either:
> > 
> > 1. Reject and fail directly. User complain why.
> > 2. Accept and keep going. Sometimes it works, sometimes don’t. It
> > depends on the device and get into a confused situation.
> > 
> > I know there are getWidthAlignment()/getHeightAlignment() to get
> > alignment info of codecs. The results are unreliable. The only
> > reliable way I can find is don’t depends on those API and fix it
> > by ourself.
> 
> Given how temperamental MC seems to be a "belt and braces" approach
> might be appropriate when dealing with it. Tell users (ffmpeg.c is a
> user here) that dimensions must be aligned by 16x16 and then
> automagically doing the required padding and cropping somewhere (lavf
> or ffmpeg.c) feels like a decent solution.

Come to think of it this kind of 16x16 requirement is very common and
is already being handled silently: it's the macroblock size for almost
every DCT codec when using 4:2:0 subsampling.

/Tomas

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v3 7/8] fftools/ffprobe: prefer fd over pipe for seek support

2022-12-14 Thread Zhao Zhili
From: Zhao Zhili 

---
 fftools/ffprobe.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index d2f126d9d6..c18aee9846 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -3714,7 +3714,7 @@ static void opt_input_file(void *optctx, const char *arg)
 exit_program(1);
 }
 if (!strcmp(arg, "-"))
-arg = "pipe:";
+arg = "fd:";
 input_filename = arg;
 }
 
@@ -3733,7 +3733,7 @@ static void opt_output_file(void *optctx, const char *arg)
 exit_program(1);
 }
 if (!strcmp(arg, "-"))
-arg = "pipe:";
+arg = "fd:";
 output_filename = arg;
 }
 
-- 
2.25.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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v3 8/8] fftools/ffmpeg_demux: prefer fd over pipe for seek support

2022-12-14 Thread Zhao Zhili
From: Zhao Zhili 

---
Because fate tests can concat multiple results to a single output, we can't
do the same for muxer, unless making a lot of modification on fate-run.sh.
Although unlikely, our users may do the same thing.

 fftools/ffmpeg_demux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index be0e8970ba..4b5c62b0d5 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -883,7 +883,7 @@ int ifile_open(const OptionsContext *o, const char 
*filename)
 }
 
 if (!strcmp(filename, "-"))
-filename = "pipe:";
+filename = "fd:";
 
 stdin_interaction &= strncmp(filename, "pipe:", 5) &&
  strcmp(filename, "fd:") &&
-- 
2.25.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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v3 6/8] fftools/ffplay: prefer fd over pipe for seek support

2022-12-14 Thread Zhao Zhili
From: Zhao Zhili 

---
 fftools/ffplay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fftools/ffplay.c b/fftools/ffplay.c
index fc7e1c2fb1..d6479aef5f 100644
--- a/fftools/ffplay.c
+++ b/fftools/ffplay.c
@@ -3537,7 +3537,7 @@ static void opt_input_file(void *optctx, const char 
*filename)
 exit(1);
 }
 if (!strcmp(filename, "-"))
-filename = "pipe:";
+filename = "fd:";
 input_filename = filename;
 }
 
-- 
2.25.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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v3 5/8] fftools/ffmpeg_demux: disable stdin interaction for fd protocol

2022-12-14 Thread Zhao Zhili
From: Zhao Zhili 

---
 fftools/ffmpeg_demux.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index e845e6784d..be0e8970ba 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -886,6 +886,7 @@ int ifile_open(const OptionsContext *o, const char 
*filename)
 filename = "pipe:";
 
 stdin_interaction &= strncmp(filename, "pipe:", 5) &&
+ strcmp(filename, "fd:") &&
  strcmp(filename, "/dev/stdin");
 
 /* get default parameters from command line */
-- 
2.25.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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v3 4/8] avformat/file: add fd protocol

2022-12-14 Thread Zhao Zhili
From: Zhao Zhili 

Unlike the pipe protocol, fd protocol has seek support if it
corresponding to a regular file.
---
 doc/protocols.texi  | 27 +
 libavformat/Makefile|  1 +
 libavformat/file.c  | 87 +
 libavformat/protocols.c |  1 +
 libavformat/version.h   |  4 +-
 5 files changed, 101 insertions(+), 19 deletions(-)

diff --git a/doc/protocols.texi b/doc/protocols.texi
index a686a7f0ac..21ae6181a0 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -275,6 +275,33 @@ For example, to convert a GIF file given inline with 
@command{ffmpeg}:
 ffmpeg -i 
"data:image/gif;base64,R0lGODdhCAAIAMIE//8AAP//AP///ywACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs="
 smiley.png
 @end example
 
+@section fd
+
+File descriptor access protocol.
+
+The accepted syntax is:
+@example
+fd: -fd @var{file_descriptor}
+@end example
+
+If @option{fd} is not specified, by default the stdout file descriptor will be
+used for writing, stdin for reading. Unlike the pipe protocol, fd protocol has
+seek support if it corresponding to a regular file. fd protocol doesn't support
+pass file descriptor via URL for security.
+
+This protocol accepts the following options:
+
+@table @option
+@item blocksize
+Set I/O operation maximum block size, in bytes. Default value is
+@code{INT_MAX}, which results in not limiting the requested block size.
+Setting this value reasonably low improves user termination request reaction
+time, which is valuable if data transmission is slow.
+
+@item fd
+Set file descriptor.
+@end table
+
 @section file
 
 File access protocol.
diff --git a/libavformat/Makefile b/libavformat/Makefile
index d7f198bf39..1452216e29 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -647,6 +647,7 @@ OBJS-$(CONFIG_DATA_PROTOCOL) += data_uri.o
 OBJS-$(CONFIG_FFRTMPCRYPT_PROTOCOL)  += rtmpcrypt.o rtmpdigest.o rtmpdh.o
 OBJS-$(CONFIG_FFRTMPHTTP_PROTOCOL)   += rtmphttp.o
 OBJS-$(CONFIG_FILE_PROTOCOL) += file.o
+OBJS-$(CONFIG_FD_PROTOCOL)   += file.o
 OBJS-$(CONFIG_FTP_PROTOCOL)  += ftp.o urldecode.o
 OBJS-$(CONFIG_GOPHER_PROTOCOL)   += gopher.o
 OBJS-$(CONFIG_GOPHERS_PROTOCOL)  += gopher.o
diff --git a/libavformat/file.c b/libavformat/file.c
index 878983a336..d20208e31f 100644
--- a/libavformat/file.c
+++ b/libavformat/file.c
@@ -110,6 +110,13 @@ static const AVClass pipe_class = {
 .version= LIBAVUTIL_VERSION_INT,
 };
 
+static const AVClass fd_class = {
+.class_name = "fd",
+.item_name  = av_default_item_name,
+.option = pipe_options,
+.version= LIBAVUTIL_VERSION_INT,
+};
+
 static int file_read(URLContext *h, unsigned char *buf, int size)
 {
 FileContext *c = h->priv_data;
@@ -197,6 +204,23 @@ static int file_close(URLContext *h)
 return (ret == -1) ? AVERROR(errno) : 0;
 }
 
+/* XXX: use llseek */
+static int64_t file_seek(URLContext *h, int64_t pos, int whence)
+{
+FileContext *c = h->priv_data;
+int64_t ret;
+
+if (whence == AVSEEK_SIZE) {
+struct stat st;
+ret = fstat(c->fd, );
+return ret < 0 ? AVERROR(errno) : (S_ISFIFO(st.st_mode) ? 0 : 
st.st_size);
+}
+
+ret = lseek(c->fd, pos, whence);
+
+return ret < 0 ? AVERROR(errno) : ret;
+}
+
 #if CONFIG_FILE_PROTOCOL
 
 static int file_delete(URLContext *h)
@@ -276,23 +300,6 @@ static int file_open(URLContext *h, const char *filename, 
int flags)
 return 0;
 }
 
-/* XXX: use llseek */
-static int64_t file_seek(URLContext *h, int64_t pos, int whence)
-{
-FileContext *c = h->priv_data;
-int64_t ret;
-
-if (whence == AVSEEK_SIZE) {
-struct stat st;
-ret = fstat(c->fd, );
-return ret < 0 ? AVERROR(errno) : (S_ISFIFO(st.st_mode) ? 0 : 
st.st_size);
-}
-
-ret = lseek(c->fd, pos, whence);
-
-return ret < 0 ? AVERROR(errno) : ret;
-}
-
 static int file_open_dir(URLContext *h)
 {
 #if HAVE_LSTAT
@@ -441,3 +448,49 @@ const URLProtocol ff_pipe_protocol = {
 };
 
 #endif /* CONFIG_PIPE_PROTOCOL */
+
+#if CONFIG_FD_PROTOCOL
+
+static int fd_open(URLContext *h, const char *filename, int flags)
+{
+FileContext *c = h->priv_data;
+struct stat st;
+
+if (strcmp(filename, "fd:") != 0) {
+av_log(h, AV_LOG_ERROR, "Doesn't support pass file descriptor via URL,"
+" please set it via -fd {num}\n");
+return AVERROR(EINVAL);
+}
+
+if (c->fd < 0) {
+if (flags & AVIO_FLAG_WRITE) {
+c->fd = 1;
+} else {
+c->fd = 0;
+}
+}
+if (fstat(c->fd, ) < 0)
+return AVERROR(errno);
+h->is_streamed = !(S_ISREG(st.st_mode) || S_ISBLK(st.st_mode));
+c->fd = fd_dup(h, c->fd);
+if (c->fd == -1)
+return AVERROR(errno);
+
+return 0;
+}
+
+const URLProtocol ff_fd_protocol = {
+.name= "fd",
+.url_open= fd_open,
+.url_read   

[FFmpeg-devel] [PATCH v3 0/8] add fd protocol

2022-12-14 Thread Zhao Zhili
From: Zhao Zhili 

v2:
1. Forbid pass file descriptor via fd:{num}, instead of -fd option
2. Set CLOEXEC
3. Prefer fd over pipe for fftools

v1: dup file descriptor

Zhao Zhili (8):
  avformat/file: add fd option for pipe
  avformat/file: reindent after the previous commit
  avformat/file: dup file descriptor for pipe
  avformat/file: add fd protocol
  fftools/ffmpeg_demux: disable stdin interaction for fd protocol
  fftools/ffplay: prefer fd over pipe for seek support
  fftools/ffprobe: prefer fd over pipe for seek support
  fftools/ffmpeg_demux: prefer fd over pipe for seek support

 doc/protocols.texi  |  31 +++-
 fftools/ffmpeg_demux.c  |   3 +-
 fftools/ffplay.c|   2 +-
 fftools/ffprobe.c   |   4 +-
 libavformat/Makefile|   1 +
 libavformat/file.c  | 152 +++-
 libavformat/protocols.c |   1 +
 libavformat/version.h   |   4 +-
 8 files changed, 156 insertions(+), 42 deletions(-)

-- 
2.25.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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v3 1/8] avformat/file: add fd option for pipe

2022-12-14 Thread Zhao Zhili
From: Zhao Zhili 

---
 doc/protocols.texi| 4 +++-
 libavformat/file.c| 9 +++--
 libavformat/version.h | 2 +-
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/doc/protocols.texi b/doc/protocols.texi
index d1c6fced7b..a686a7f0ac 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -687,7 +687,7 @@ The accepted syntax is:
 pipe:[@var{number}]
 @end example
 
-@var{number} is the number corresponding to the file descriptor of the
+If @option{fd} isn't specified, @var{number} is the number corresponding to 
the file descriptor of the
 pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr).  If @var{number}
 is not specified, by default the stdout file descriptor will be used
 for writing, stdin for reading.
@@ -714,6 +714,8 @@ Set I/O operation maximum block size, in bytes. Default 
value is
 @code{INT_MAX}, which results in not limiting the requested block size.
 Setting this value reasonably low improves user termination request reaction
 time, which is valuable if data transmission is slow.
+@item fd
+Set file descriptor.
 @end table
 
 Note that some formats (typically MOV), require the output protocol to
diff --git a/libavformat/file.c b/libavformat/file.c
index 6103c37b34..db619fcaac 100644
--- a/libavformat/file.c
+++ b/libavformat/file.c
@@ -92,6 +92,7 @@ static const AVOption file_options[] = {
 
 static const AVOption pipe_options[] = {
 { "blocksize", "set I/O operation maximum block size", 
offsetof(FileContext, blocksize), AV_OPT_TYPE_INT, { .i64 = INT_MAX }, 1, 
INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
+{ "fd", "set file descriptor", offsetof(FileContext, fd), AV_OPT_TYPE_INT, 
{ .i64 = -1 }, -1, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
 { NULL }
 };
 
@@ -381,6 +382,8 @@ static int pipe_open(URLContext *h, const char *filename, 
int flags)
 FileContext *c = h->priv_data;
 int fd;
 char *final;
+
+if (c->fd < 0) {
 av_strstart(filename, "pipe:", );
 
 fd = strtol(filename, , 10);
@@ -391,10 +394,12 @@ static int pipe_open(URLContext *h, const char *filename, 
int flags)
 fd = 0;
 }
 }
+c->fd = fd;
+}
+
 #if HAVE_SETMODE
-setmode(fd, O_BINARY);
+setmode(c->fd, O_BINARY);
 #endif
-c->fd = fd;
 h->is_streamed = 1;
 return 0;
 }
diff --git a/libavformat/version.h b/libavformat/version.h
index a7e5a9ac66..63e753a3aa 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -32,7 +32,7 @@
 #include "version_major.h"
 
 #define LIBAVFORMAT_VERSION_MINOR  34
-#define LIBAVFORMAT_VERSION_MICRO 102
+#define LIBAVFORMAT_VERSION_MICRO 103
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
-- 
2.25.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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v3 3/8] avformat/file: dup file descriptor for pipe

2022-12-14 Thread Zhao Zhili
From: Zhao Zhili 

---
 libavformat/file.c | 44 ++--
 1 file changed, 34 insertions(+), 10 deletions(-)

diff --git a/libavformat/file.c b/libavformat/file.c
index a56be64342..878983a336 100644
--- a/libavformat/file.c
+++ b/libavformat/file.c
@@ -167,6 +167,36 @@ static int file_check(URLContext *h, int mask)
 return ret;
 }
 
+static int fd_dup(URLContext *h, int oldfd)
+{
+int newfd;
+
+#ifdef F_DUPFD_CLOEXEC
+newfd = fcntl(oldfd, F_DUPFD_CLOEXEC, 0);
+#else
+newfd = dup(oldfd);
+#endif
+if (newfd == -1)
+return newfd;
+
+#if HAVE_FCNTL
+if (fcntl(newfd, F_SETFD, FD_CLOEXEC) == -1)
+av_log(h, AV_LOG_DEBUG, "Failed to set close on exec\n");
+#endif
+
+#if HAVE_SETMODE
+setmode(newfd, O_BINARY);
+#endif
+return newfd;
+}
+
+static int file_close(URLContext *h)
+{
+FileContext *c = h->priv_data;
+int ret = close(c->fd);
+return (ret == -1) ? AVERROR(errno) : 0;
+}
+
 #if CONFIG_FILE_PROTOCOL
 
 static int file_delete(URLContext *h)
@@ -263,13 +293,6 @@ static int64_t file_seek(URLContext *h, int64_t pos, int 
whence)
 return ret < 0 ? AVERROR(errno) : ret;
 }
 
-static int file_close(URLContext *h)
-{
-FileContext *c = h->priv_data;
-int ret = close(c->fd);
-return (ret == -1) ? AVERROR(errno) : 0;
-}
-
 static int file_open_dir(URLContext *h)
 {
 #if HAVE_LSTAT
@@ -397,9 +420,9 @@ static int pipe_open(URLContext *h, const char *filename, 
int flags)
 c->fd = fd;
 }
 
-#if HAVE_SETMODE
-setmode(c->fd, O_BINARY);
-#endif
+c->fd = fd_dup(h, c->fd);
+if (c->fd == -1)
+return AVERROR(errno);
 h->is_streamed = 1;
 return 0;
 }
@@ -409,6 +432,7 @@ const URLProtocol ff_pipe_protocol = {
 .url_open= pipe_open,
 .url_read= file_read,
 .url_write   = file_write,
+.url_close   = file_close,
 .url_get_file_handle = file_get_handle,
 .url_check   = file_check,
 .priv_data_size  = sizeof(FileContext),
-- 
2.25.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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v3 2/8] avformat/file: reindent after the previous commit

2022-12-14 Thread Zhao Zhili
From: Zhao Zhili 

---
 libavformat/file.c | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/libavformat/file.c b/libavformat/file.c
index db619fcaac..a56be64342 100644
--- a/libavformat/file.c
+++ b/libavformat/file.c
@@ -384,17 +384,17 @@ static int pipe_open(URLContext *h, const char *filename, 
int flags)
 char *final;
 
 if (c->fd < 0) {
-av_strstart(filename, "pipe:", );
-
-fd = strtol(filename, , 10);
-if((filename == final) || *final ) {/* No digits found, or something like 
10ab */
-if (flags & AVIO_FLAG_WRITE) {
-fd = 1;
-} else {
-fd = 0;
+av_strstart(filename, "pipe:", );
+
+fd = strtol(filename, , 10);
+if((filename == final) || *final ) {/* No digits found, or something 
like 10ab */
+if (flags & AVIO_FLAG_WRITE) {
+fd = 1;
+} else {
+fd = 0;
+}
 }
-}
-c->fd = fd;
+c->fd = fd;
 }
 
 #if HAVE_SETMODE
-- 
2.25.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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v3 3/7] avcodec/mediacodecenc: use bsf to handle crop

2022-12-14 Thread Tomas Härdin
tis 2022-12-13 klockan 11:20 +0800 skrev zhilizhao(赵志立):
> 
> 
> > On Dec 12, 2022, at 23:27, Tomas Härdin  wrote:
> > 
> > lör 2022-12-10 klockan 01:22 +0800 skrev Zhao Zhili:
> > > From: Zhao Zhili 
> > > 
> > > It's well known that mediacodec encoder requires 16x16 alignment.
> > > Use our bsf to fix the crop info.
> > > ---
> > > v3: don't change the dimension for AV_PIX_FMT_MEDIACODEC. It can
> > > have
> > > side effect.
> > 
> > Looks like this silently crops? Is that really a good idea? We
> > usually
> > don't do stuff like that. For example codecs that require even
> > dimensions complain loudly then fail.
> 
> It’s reasonable to require even dimensions. Require dimensions
> aligned
> to 16 is uncommon. Everyone will complain why 1080x1920 doesn’t work.
> 
> A lot of apps just use aligned dimensions. Users have no control on
> these apps. It’s not the same with FFmpeg, users (developer or not)
> can specify the dimension directly.

Wait a sec, I think I was misunderstanding what the code is doing.
FFALIGN rounds *up*. Does this mean you insert fake data in the border
that then gets cropped away, meaning the original essence is still
"there"? That's a different thing and probably perfectly OK.

I think we might want something for this inside lavf somewhere, so that
encoders can signal dimension alignment requirements. Some containers
(MXF, MOV) support such cropping in a codec-agnostic manner.

> 
> If we don’t fix it, either:
> 
> 1. Reject and fail directly. User complain why.
> 2. Accept and keep going. Sometimes it works, sometimes don’t. It
> depends on the device and get into a confused situation.
> 
> I know there are getWidthAlignment()/getHeightAlignment() to get
> alignment info of codecs. The results are unreliable. The only
> reliable way I can find is don’t depends on those API and fix it
> by ourself.

Given how temperamental MC seems to be a "belt and braces" approach
might be appropriate when dealing with it. Tell users (ffmpeg.c is a
user here) that dimensions must be aligned by 16x16 and then
automagically doing the required padding and cropping somewhere (lavf
or ffmpeg.c) feels like a decent solution.

/Tomas

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] shared and dev folders download

2022-12-14 Thread Lloyd Portes
Hi, 
I'm looking for a 3.4.2 download for shared and dev folders on arch 64. I can't 
seem to find it online. Any help would be greatly appreciated.
Thanks :)Lloyd
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v3] avformat/movenc: correct write_colr warning placement

2022-12-14 Thread Zhao Zhili

> -Original Message-
> From: ffmpeg-devel  On Behalf Of Gyan Doshi
> Sent: 2022年12月14日 20:49
> To: ffmpeg-devel@ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH v3] avformat/movenc: correct write_colr 
> warning placement
> 
> 
> 
> On 2022-12-14 06:10 pm, "zhilizhao(赵志立)" wrote:
> >
> >> On Dec 14, 2022, at 19:58, Gyan Doshi  wrote:
> >>
> >> The old warning is no longer applicable in the inner block after
> >> c5b20cfe19.
> >> ---
> >> libavformat/movenc.c | 5 +++--
> >> 1 file changed, 3 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> >> index 7b00e65cdd..c427109609 100644
> >> --- a/libavformat/movenc.c
> >> +++ b/libavformat/movenc.c
> >> @@ -2330,10 +2330,11 @@ static int mov_write_video_tag(AVFormatContext *s, 
> >> AVIOContext *pb, MOVMuxContex
> >>  av_stream_get_side_data(track->st, AV_PKT_DATA_ICC_PROFILE, 
> >> NULL)) {
> >>  int prefer_icc = mov->flags & FF_MOV_FLAG_PREFER_ICC || 
> >> !has_color_info;
> >>  mov_write_colr_tag(pb, track, prefer_icc);
> >> -} else if (mov->flags & FF_MOV_FLAG_WRITE_COLR) {
> >> - av_log(mov->fc, AV_LOG_WARNING, "Not writing 'colr' atom. 
> >> Format is not MOV or MP4.\n");
> >>  }
> >> +} else if (mov->flags & FF_MOV_FLAG_WRITE_COLR) {
> >> +av_log(mov->fc, AV_LOG_WARNING, "Not writing 'colr' atom. 
> >> Format is not MOV or MP4 or AVIF.\n");
> > LGTM except the indentation.
> 
> Do you mean the log line?

Yes. You can fix it locally before push.

> 
> 
> >
> >>  }
> >> +
> >>  if (track->mode == MODE_MOV || track->mode == MODE_MP4) {
> >>  mov_write_clli_tag(pb, track);
> >>  mov_write_mdcv_tag(pb, track);
> >> --
> >> 2.36.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-requ...@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-requ...@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-requ...@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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [REFUND-REQUEST] Travel to Developer Meeting

2022-12-14 Thread Derek Buitenhuis
Hello,

I travelled to Barcelona for the developer meeting.

I am only requesting for my flight, as I chose to stay in non-VideoLAN hotel.

Flight: £111.98 - receipt available, of course.

As I am not super active currently, understandable if I cannot put this through 
SPI.

Cheers,
- Derek
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v14 9/9] avcodec/evc: Changes in Changelog and MAINTAINERS files

2022-12-14 Thread Dawid Kozinski/Multimedia (PLT) /SRPOL/Staff Engineer/Samsung Electronics
Hi,

Thank you for your prompt response.

Lynne told me that Michael has made it clear that anyone on the list must
have commit rights. I don't have commit rights so I removed my records from
the MAINTAINERS file.
Regardless, I will maintain the code related to the EVC codec as long as I
can.

Best regards 
Dawid



-Original Message-
From: ffmpeg-devel  On Behalf Of Ronald S.
Bultje
Sent: wtorek, 13 grudnia 2022 14:33
To: FFmpeg development discussions and patches 
Subject: Re: [FFmpeg-devel] [PATCH v14 9/9] avcodec/evc: Changes in
Changelog and MAINTAINERS files

Hi David,

On Tue, Dec 13, 2022 at 7:22 AM Dawid Kozinski/Multimedia (PLT) /SRPOL/Staff
Engineer/Samsung Electronics  wrote:

> Should I leave the following lines:
> +  libxevd.c Dawid Kozinski
> +  libxeve.c,Dawid Kozinski
> +  evc.c, evc.hDawid Kozinski
> +  evcdec.c Dawid Kozinski
> +  evc_parser.c  Dawid Kozinski
>
> or should I remove them?
>

Here's a question for you, and the answer probably becomes self-evident from
that. If you, Dawid, stop working for Samsung, for example because you're
starting your own business or Samsung fires you or Google hires you, or if
Samsung stops sponsoring this new codec called "EVC" or stops contributing
to this new library "libxeve". Will you, Dawid, still maintain these files?

If the answer is yes, then you can shorten these lines ("evc*.[ch]: Dawid"
& "livxev[ed].c: Dawid") and keep them.

If the answer is no, then I think you should remove (or adjust) these lines,
since they are (in their current form) inaccurate: you are not maintaining
these files, your company is.

> We are expecting a clear and consistent standpoint on this matter.

This makes no sense: our community is a mish-mash of individuals, each
entitled to their own opinion. If we - as a community - can't agree, you can
ask for a formal opinion from the technical committee.

Ronald
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email ffmpeg-devel-requ...@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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v14 9/9] avcodec/evc: Changes in Changelog and MAINTAINERS files

2022-12-14 Thread Dawid Kozinski/Multimedia (PLT) /SRPOL/Staff Engineer/Samsung Electronics
Hi,

Thank you for your prompt response.
We've removed from the MAINTAINERS file all our records and just submitted
new patches to the patchwork.

Regardless of the above, I will maintain the code related to the EVC codec
as long as I can.

Best regards 
Dawid


-Original Message-
From: ffmpeg-devel  On Behalf Of Lynne
Sent: wtorek, 13 grudnia 2022 19:42
To: FFmpeg development discussions and patches 
Subject: Re: [FFmpeg-devel] [PATCH v14 9/9] avcodec/evc: Changes in
Changelog and MAINTAINERS files

Dec 13, 2022, 13:22 by d.kozin...@samsung.com:

> We made some changes in our EVC wrapper implementation and would like 
> to submit new patches to patchwork, but it's still unclear to me how 
> to deal with the MAINTAINERS file.
>
> Should I leave the following lines:
> +  libxevd.c Dawid Kozinski
> +  libxeve.c,Dawid Kozinski
> +  evc.c, evc.hDawid Kozinski
> +  evcdec.c Dawid Kozinski
> +  evc_parser.c  Dawid Kozinski
>
> or should I remove them?
>
> We are expecting a clear and consistent standpoint on this matter.
>

Get rid of them. Michael has made it clear anyone on the list must have
commit rights. I'm not for blocking anyone from having commit rights, but
you've made zero contributions to the project so far,

I hope it will change soon 

 and maintaining requires some level of dedication.

If you want someone to blame for this, blame Michael. He silently changed to
whom he gives out commit rights, without informing anyone, and without even
joining any discussions when this question is brought up.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email ffmpeg-devel-requ...@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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] FFmpeg Media concatenation issue on other system

2022-12-14 Thread Carl Eugen Hoyos
Am Mi., 14. Dez. 2022 um 13:09 Uhr schrieb Sagar Upadhyay
:

> I am using FFmpeg

Please post all user questions on the user mailing list:
https://lists.ffmpeg.org/mailman/listinfo/ffmpeg-user/

Please remember not to post screen-shots there but
copy command line and console output as text into
your message.

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v3] avformat/movenc: correct write_colr warning placement

2022-12-14 Thread Gyan Doshi



On 2022-12-14 06:10 pm, "zhilizhao(赵志立)" wrote:



On Dec 14, 2022, at 19:58, Gyan Doshi  wrote:

The old warning is no longer applicable in the inner block after
c5b20cfe19.
---
libavformat/movenc.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 7b00e65cdd..c427109609 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2330,10 +2330,11 @@ static int mov_write_video_tag(AVFormatContext *s, 
AVIOContext *pb, MOVMuxContex
 av_stream_get_side_data(track->st, AV_PKT_DATA_ICC_PROFILE, NULL)) 
{
 int prefer_icc = mov->flags & FF_MOV_FLAG_PREFER_ICC || 
!has_color_info;
 mov_write_colr_tag(pb, track, prefer_icc);
-} else if (mov->flags & FF_MOV_FLAG_WRITE_COLR) {
- av_log(mov->fc, AV_LOG_WARNING, "Not writing 'colr' atom. Format is 
not MOV or MP4.\n");
 }
+} else if (mov->flags & FF_MOV_FLAG_WRITE_COLR) {
+av_log(mov->fc, AV_LOG_WARNING, "Not writing 'colr' atom. Format is not 
MOV or MP4 or AVIF.\n");

LGTM except the indentation.


Do you mean the log line?


  

 }
+
 if (track->mode == MODE_MOV || track->mode == MODE_MP4) {
 mov_write_clli_tag(pb, track);
 mov_write_mdcv_tag(pb, track);
--
2.36.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-requ...@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-requ...@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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v3] avformat/movenc: correct write_colr warning placement

2022-12-14 Thread zhilizhao(赵志立)



> On Dec 14, 2022, at 19:58, Gyan Doshi  wrote:
> 
> The old warning is no longer applicable in the inner block after
> c5b20cfe19.
> ---
> libavformat/movenc.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index 7b00e65cdd..c427109609 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -2330,10 +2330,11 @@ static int mov_write_video_tag(AVFormatContext *s, 
> AVIOContext *pb, MOVMuxContex
> av_stream_get_side_data(track->st, AV_PKT_DATA_ICC_PROFILE, 
> NULL)) {
> int prefer_icc = mov->flags & FF_MOV_FLAG_PREFER_ICC || 
> !has_color_info;
> mov_write_colr_tag(pb, track, prefer_icc);
> -} else if (mov->flags & FF_MOV_FLAG_WRITE_COLR) {
> - av_log(mov->fc, AV_LOG_WARNING, "Not writing 'colr' atom. 
> Format is not MOV or MP4.\n");
> }
> +} else if (mov->flags & FF_MOV_FLAG_WRITE_COLR) {
> +av_log(mov->fc, AV_LOG_WARNING, "Not writing 'colr' atom. Format 
> is not MOV or MP4 or AVIF.\n");

LGTM except the indentation.
 
> }
> +
> if (track->mode == MODE_MOV || track->mode == MODE_MP4) {
> mov_write_clli_tag(pb, track);
> mov_write_mdcv_tag(pb, track);
> -- 
> 2.36.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-requ...@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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v15 9/9] avcodec/evc: Changes in Changelog file

2022-12-14 Thread Dawid Kozinski
- Changelog update

Signed-off-by: Dawid Kozinski 
---
 Changelog | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Changelog b/Changelog
index af2dd65f8f..5fd778d06c 100644
--- a/Changelog
+++ b/Changelog
@@ -54,6 +54,8 @@ version 5.1:
 - remap_opencl filter
 - added chromakey_cuda filter
 - added bilateral_cuda filter
+- eXtra-fast Essential Video Encoder (XEVE)
+- eXtra-fast Essential Video Decoder (XEVD)
 
 
 version 5.0:
@@ -101,7 +103,6 @@ version 5.0:
 - anlmf audio filter
 - IMF demuxer (experimental)
 
-
 version 4.4:
 - AudioToolbox output device
 - MacCaption demuxer
-- 
2.17.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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v15 8/9] avformat/mov_demuxer: Extended MOV demuxer to handle EVC video content

2022-12-14 Thread Dawid Kozinski
- Added evc extension to the list of extensions for ff_mov_demuxer

Signed-off-by: Dawid Kozinski 
---
 libavformat/demux.c | 1 +
 libavformat/mov.c   | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/demux.c b/libavformat/demux.c
index 2dfd82a63c..f3ebe4d09b 100644
--- a/libavformat/demux.c
+++ b/libavformat/demux.c
@@ -120,6 +120,7 @@ static int set_codec_from_probe_data(AVFormatContext *s, 
AVStream *st,
 { "mp3",AV_CODEC_ID_MP3,  AVMEDIA_TYPE_AUDIO},
 { "mpegvideo",  AV_CODEC_ID_MPEG2VIDEO,   AVMEDIA_TYPE_VIDEO},
 { "truehd", AV_CODEC_ID_TRUEHD,   AVMEDIA_TYPE_AUDIO},
+{ "evc",AV_CODEC_ID_EVC,  AVMEDIA_TYPE_VIDEO},
 { 0 }
 };
 int score;
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 29bd3103e3..ab1776e1c4 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2507,6 +2507,7 @@ static int mov_finalize_stsd_codec(MOVContext *c, 
AVIOContext *pb,
 case AV_CODEC_ID_VP9:
 sti->need_parsing = AVSTREAM_PARSE_FULL;
 break;
+case AV_CODEC_ID_EVC:
 case AV_CODEC_ID_AV1:
 /* field_order detection of H264 requires parsing */
 case AV_CODEC_ID_H264:
@@ -9135,7 +9136,7 @@ const AVInputFormat ff_mov_demuxer = {
 .long_name  = NULL_IF_CONFIG_SMALL("QuickTime / MOV"),
 .priv_class = _class,
 .priv_data_size = sizeof(MOVContext),
-.extensions = "mov,mp4,m4a,3gp,3g2,mj2,psp,m4b,ism,ismv,isma,f4v,avif",
+.extensions = 
"mov,mp4,m4a,3gp,3g2,mj2,psp,m4b,ism,ismv,isma,f4v,avif,evc",
 .flags_internal = FF_FMT_INIT_CLEANUP,
 .read_probe = mov_probe,
 .read_header= mov_read_header,
-- 
2.17.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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v15 7/9] avformat/mov_muxer: Extended MOV muxer to handle EVC video content

2022-12-14 Thread Dawid Kozinski
- Changes in mov_write_video_tag function to handle EVC elementary stream
- Provided structure EVCDecoderConfigurationRecord that specifies the decoder 
configuration information for ISO/IEC 23094-1 video content

Signed-off-by: Dawid Kozinski 
---
 libavformat/Makefile|   2 +-
 libavformat/evc.c   | 455 
 libavformat/evc.h   |  44 
 libavformat/isom_tags.c |   2 +
 libavformat/movenc.c|  33 +++
 5 files changed, 535 insertions(+), 1 deletion(-)
 create mode 100644 libavformat/evc.c
 create mode 100644 libavformat/evc.h

diff --git a/libavformat/Makefile b/libavformat/Makefile
index af175d2097..6ae5056c61 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -363,7 +363,7 @@ OBJS-$(CONFIG_MOV_DEMUXER)   += mov.o 
mov_chan.o mov_esds.o \
 OBJS-$(CONFIG_MOV_MUXER) += movenc.o av1.o avc.o hevc.o vpcc.o 
\
 movenchint.o mov_chan.o rtp.o \
 movenccenc.o movenc_ttml.o 
rawutils.o \
-dovi_isom.o
+dovi_isom.o evc.o
 OBJS-$(CONFIG_MP2_MUXER) += rawenc.o
 OBJS-$(CONFIG_MP3_DEMUXER)   += mp3dec.o replaygain.o
 OBJS-$(CONFIG_MP3_MUXER) += mp3enc.o rawenc.o id3v2enc.o
diff --git a/libavformat/evc.c b/libavformat/evc.c
new file mode 100644
index 00..42b7731c8f
--- /dev/null
+++ b/libavformat/evc.c
@@ -0,0 +1,455 @@
+/*
+ * EVC helper functions for muxers
+ * Copyright (c) 2022 Dawid Kozinski 
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/intreadwrite.h"
+#include "libavcodec/get_bits.h"
+#include "libavcodec/golomb.h"
+#include "libavcodec/evc.h"
+#include "avformat.h"
+#include "avio.h"
+#include "evc.h"
+#include "avio_internal.h"
+
+// The length field that indicates the length in bytes of the following NAL 
unit is configured to be of 4 bytes
+#define EVC_NALU_LENGTH_PREFIX_SIZE(4)  /* byte */
+#define EVC_NALU_HEADER_SIZE (2)  /* byte */
+
+// @see ISO/IEC 14496-15:2021 Coding of audio-visual objects - Part 15: 
section 12.3.3.1
+enum {
+SPS_INDEX,
+PPS_INDEX,
+APS_INDEX,
+SEI_INDEX,
+NB_ARRAYS
+};
+
+// rpl structure
+typedef struct RefPicListStruct {
+int poc;
+int tid;
+int ref_pic_num;
+int ref_pic_active_num;
+int ref_pics[EVC_MAX_NUM_REF_PICS];
+char pic_type;
+
+} RefPicListStruct;
+
+// The sturcture reflects SPS RBSP(raw byte sequence payload) layout
+// @see ISO_IEC_23094-1 section 7.3.2.1
+//
+// The following descriptors specify the parsing process of each element
+// u(n) - unsigned integer using n bits
+// ue(v) - unsigned integer 0-th order Exp_Golomb-coded syntax element with 
the left bit first
+typedef struct EVCSPS {
+int sps_seq_parameter_set_id;   // ue(v)
+int profile_idc;// u(8)
+int level_idc;  // u(8)
+int toolset_idc_h;  // u(32)
+int toolset_idc_l;  // u(32)
+int chroma_format_idc;  // ue(v)
+int pic_width_in_luma_samples;  // ue(v)
+int pic_height_in_luma_samples; // ue(v)
+int bit_depth_luma_minus8;  // ue(v)
+int bit_depth_chroma_minus8;// ue(v)
+
+// @note
+// Currently the structure does not reflect the entire SPS RBSP layout.
+// It contains only the fields that are necessary to read from the NAL 
unit all the values
+// necessary for the correct initialization of 
EVCDecoderConfigurationRecord
+
+// @note
+// If necessary, add the missing fields to the structure to reflect
+// the contents of the entire NAL unit of the SPS type
+
+} EVCSPS;
+
+// @see ISO/IEC 14496-15:2021 Coding of audio-visual objects - Part 15: 
section 12.3.3.3
+typedef struct EVCNALUnitArray {
+uint8_t  array_completeness; // when equal to 1 indicates that all NAL 
units of the given type are in the following array
+uint8_t  NAL_unit_type;  // indicates the type of the NAL units in the 
following array
+uint16_t numNalus;   // indicates the number of NAL units of the 
indicated type
+uint16_t *nalUnitLength; // 

[FFmpeg-devel] [PATCH v15 6/9] avcodec/evc_decoder: Provided support for EVC decoder

2022-12-14 Thread Dawid Kozinski
- Added EVC decoder wrapper
- Changes in project configuration file and libavcodec Makefile
- Added documentation for xevd wrapper

Signed-off-by: Dawid Kozinski 
---
 configure |   4 +
 doc/decoders.texi |  24 +++
 doc/general_contents.texi |  10 +-
 libavcodec/Makefile   |   1 +
 libavcodec/allcodecs.c|   1 +
 libavcodec/libxevd.c  | 400 ++
 6 files changed, 439 insertions(+), 1 deletion(-)
 create mode 100644 libavcodec/libxevd.c

diff --git a/configure b/configure
index 3657fee06d..b092896a2d 100755
--- a/configure
+++ b/configure
@@ -292,6 +292,7 @@ External library support:
   --enable-libx264 enable H.264 encoding via x264 [no]
   --enable-libx265 enable HEVC encoding via x265 [no]
   --enable-libxeve enable EVC encoding via libxeve [no]
+  --enable-libxevd enable EVC decoding via libxevd [no]
   --enable-libxavs enable AVS encoding via xavs [no]
   --enable-libxavs2enable AVS2 encoding via xavs2 [no]
   --enable-libxcb  enable X11 grabbing using XCB [autodetect]
@@ -1863,6 +1864,7 @@ EXTERNAL_LIBRARY_LIST="
 libvorbis
 libvpx
 libwebp
+libxevd
 libxeve
 libxml2
 libzimg
@@ -3394,6 +3396,7 @@ libx265_encoder_deps="libx265"
 libx265_encoder_select="atsc_a53"
 libxavs_encoder_deps="libxavs"
 libxavs2_encoder_deps="libxavs2"
+libxevd_decoder_deps="libxevd"
 libxeve_encoder_deps="libxeve"
 libxvid_encoder_deps="libxvid"
 libzvbi_teletext_decoder_deps="libzvbi"
@@ -6714,6 +6717,7 @@ enabled libx265   && require_pkg_config libx265 
x265 x265.h x265_api_get
  require_cpp_condition libx265 x265.h "X265_BUILD 
>= 89"
 enabled libxavs   && require libxavs "stdint.h xavs.h" 
xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
 enabled libxavs2  && require_pkg_config libxavs2 "xavs2 >= 1.3.0" 
"stdint.h xavs2.h" xavs2_api_get
+enabled libxevd   && require_pkg_config libxevd "xevd >= 0.4.0" 
"xevd.h" xevd_decode
 enabled libxeve   && require_pkg_config libxeve "xeve >= 0.4.0" 
"xeve.h" xeve_encode
 enabled libxvid   && require libxvid xvid.h xvid_global -lxvidcore
 enabled libzimg   && require_pkg_config libzimg "zimg >= 2.7.0" zimg.h 
zimg_get_api_version
diff --git a/doc/decoders.texi b/doc/decoders.texi
index 5ba85cf9b1..54720ee8b4 100644
--- a/doc/decoders.texi
+++ b/doc/decoders.texi
@@ -130,6 +130,30 @@ Set amount of frame threads to use during decoding. The 
default value is 0 (auto
 
 @end table
 
+@section libxevd
+
+eXtra-fast Essential Video Decoder (XEVD) MPEG-5 EVC decoder wrapper.
+
+This decoder requires the presence of the libxevd headers and library
+during configuration. You need to explicitly configure the build with
+@option{--enable-libxevd}.
+
+The xevd project website is at @url{https://github.com/mpeg5/xevd}.
+
+@subsection Options
+
+The following options are supported by the libxevd wrapper.
+The xevd-equivalent options or values are listed in parentheses for easy 
migration.
+
+To get a more accurate and extensive documentation of the libxevd options,
+invoke the command  @code{xevd_app --help} or consult the libxevd 
documentation.
+
+@table @option
+@item threads (@emph{threads})
+Force to use a specific number of threads
+
+@end table
+
 @section QSV Decoders
 
 The family of Intel QuickSync Video decoders (VC1, MPEG-2, H.264, HEVC,
diff --git a/doc/general_contents.texi b/doc/general_contents.texi
index 748f516c69..38940d497a 100644
--- a/doc/general_contents.texi
+++ b/doc/general_contents.texi
@@ -351,6 +351,14 @@ Go to @url{https://github.com/mpeg5/xeve} and follow the 
instructions for
 installing the XEVE library. Then pass @code{--enable-libxeve} to configure to
 enable it.
 
+@section eXtra-fast Essential Video Decoder (XEVD)
+
+FFmpeg can make use of the XEVD library for EVC video decoding.
+
+Go to @url{https://github.com/mpeg5/xevd} and follow the instructions for
+installing the XEVD library. Then pass @code{--enable-libxevd} to configure to
+enable it.
+
 @section ZVBI
 
 ZVBI is a VBI decoding library which can be used by FFmpeg to decode DVB
@@ -944,7 +952,7 @@ following image formats are supported:
 @item Escape 124 @tab @tab  X
 @item Escape 130 @tab @tab  X
 @item EVC / MPEG-5 Part 1@tab  X  @tab  X
-@tab encoding supported through external librarys libxeve
+@tab encoding and decoding supported through external libraries libxeve 
and libxevd
 @item FFmpeg video codec #1  @tab  X  @tab  X
 @tab lossless codec (fourcc: FFV1)
 @item Flash Screen Video v1  @tab  X  @tab  X
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 8119a4cb6d..f0c41fb021 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -1119,6 +1119,7 @@ OBJS-$(CONFIG_LIBX264_ENCODER)+= libx264.o
 OBJS-$(CONFIG_LIBX265_ENCODER)+= libx265.o
 

[FFmpeg-devel] [PATCH v15 5/9] avcodec/evc_encoder: Provided support for EVC encoder

2022-12-14 Thread Dawid Kozinski
- Added EVC encoder wrapper
- Changes in project configuration file and libavcodec Makefile
- Added documentation for xeve wrapper

Signed-off-by: Dawid Kozinski 
---
 configure |   4 +
 doc/encoders.texi |  69 +
 doc/general_contents.texi |  11 +
 libavcodec/Makefile   |   1 +
 libavcodec/allcodecs.c|   1 +
 libavcodec/libxeve.c  | 618 ++
 6 files changed, 704 insertions(+)
 create mode 100644 libavcodec/libxeve.c

diff --git a/configure b/configure
index f4eedfc207..3657fee06d 100755
--- a/configure
+++ b/configure
@@ -291,6 +291,7 @@ External library support:
   --enable-libwebp enable WebP encoding via libwebp [no]
   --enable-libx264 enable H.264 encoding via x264 [no]
   --enable-libx265 enable HEVC encoding via x265 [no]
+  --enable-libxeve enable EVC encoding via libxeve [no]
   --enable-libxavs enable AVS encoding via xavs [no]
   --enable-libxavs2enable AVS2 encoding via xavs2 [no]
   --enable-libxcb  enable X11 grabbing using XCB [autodetect]
@@ -1862,6 +1863,7 @@ EXTERNAL_LIBRARY_LIST="
 libvorbis
 libvpx
 libwebp
+libxeve
 libxml2
 libzimg
 libzmq
@@ -3392,6 +3394,7 @@ libx265_encoder_deps="libx265"
 libx265_encoder_select="atsc_a53"
 libxavs_encoder_deps="libxavs"
 libxavs2_encoder_deps="libxavs2"
+libxeve_encoder_deps="libxeve"
 libxvid_encoder_deps="libxvid"
 libzvbi_teletext_decoder_deps="libzvbi"
 vapoursynth_demuxer_deps="vapoursynth"
@@ -6711,6 +6714,7 @@ enabled libx265   && require_pkg_config libx265 
x265 x265.h x265_api_get
  require_cpp_condition libx265 x265.h "X265_BUILD 
>= 89"
 enabled libxavs   && require libxavs "stdint.h xavs.h" 
xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
 enabled libxavs2  && require_pkg_config libxavs2 "xavs2 >= 1.3.0" 
"stdint.h xavs2.h" xavs2_api_get
+enabled libxeve   && require_pkg_config libxeve "xeve >= 0.4.0" 
"xeve.h" xeve_encode
 enabled libxvid   && require libxvid xvid.h xvid_global -lxvidcore
 enabled libzimg   && require_pkg_config libzimg "zimg >= 2.7.0" zimg.h 
zimg_get_api_version
 enabled libzmq&& require_pkg_config libzmq "libzmq >= 4.2.1" zmq.h 
zmq_ctx_new
diff --git a/doc/encoders.texi b/doc/encoders.texi
index b8051cda3f..15b8db76c0 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -2894,6 +2894,75 @@ ffmpeg -i input -c:v libxavs2 -xavs2-params RdoqLevel=0 
output.avs2
 @end example
 @end table
 
+@section libxeve
+
+eXtra-fast Essential Video Encoder (XEVE) MPEG-5 EVC encoder wrapper.
+The xeve-equivalent options or values are listed in parentheses for easy 
migration.
+
+This encoder requires the presence of the libxeve headers and library
+during configuration. You need to explicitly configure the build with
+@option{--enable-libxeve}.
+
+@float NOTE
+Many libxeve encoder options are mapped to FFmpeg global codec options,
+while unique encoder options are provided through private options.
+Additionally the xeve-params private options allows one to pass a list
+of key=value tuples as accepted by the libxeve @code{parse_xeve_params} 
function.
+@end float
+
+The xeve project website is at @url{https://github.com/mpeg5/xeve}.
+
+@subsection Options
+
+The following options are supported by the libxeve wrapper.
+The xeve-equivalent options or values are listed in parentheses for easy 
migration.
+
+@float NOTE
+To reduce the duplication of documentation, only the private options
+and some others requiring special attention are documented here. For
+the documentation of the undocumented generic options, see
+@ref{codec-options,,the Codec Options chapter}.
+@end float
+
+@float NOTE
+To get a more accurate and extensive documentation of the libxeve options,
+invoke the command  @code{xeve_app --help} or consult the libxeve 
documentation.
+@end float
+
+@table @option
+@item b (@emph{bitrate})
+Set target video bitrate in bits/s.
+Note that FFmpeg's b option is expressed in bits/s, while xeve's bitrate is in 
kilobits/s.
+
+@item bf (@emph{bframes})
+Set the maximum number of B frames (1,3,7,15).
+
+@item g (@emph{keyint})
+Set the GOP size (I-picture period).
+
+@item preset (@emph{preset})
+Set the xeve preset.
+Set the encoder preset value to determine encoding speed [fast, medium, slow, 
placebo]
+
+@item tune (@emph{tune})
+Set the encoder tune parameter [psnr, zerolatency]
+
+@item profile (@emph{profile})
+Set the encoder profile [0: baselie; 1: main]
+
+@item crf (@emph{crf})
+Set the quality for constant quality mode.
+Constant rate factor <10..49> [default: 32]
+
+@item qp (@emph{qp})
+Set constant quantization rate control method parameter.
+Quantization parameter qp <0..51> [default: 32]
+
+@item threads (@emph{threads})
+Force to use a specific number of threads
+
+@end table
+
 @section libxvid
 
 Xvid MPEG-4 Part 2 encoder wrapper.
diff --git 

[FFmpeg-devel] [PATCH v15 4/9] avformat/evc_demuxer: Added demuxer to handle reading EVC video files

2022-12-14 Thread Dawid Kozinski
- Provided AVInputFormat structure describing EVC input format (ff_evc_demuxer)

Signed-off-by: Dawid Kozinski 
---
 libavformat/Makefile |   1 +
 libavformat/allformats.c |   1 +
 libavformat/evcdec.c | 124 +++
 3 files changed, 126 insertions(+)
 create mode 100644 libavformat/evcdec.c

diff --git a/libavformat/Makefile b/libavformat/Makefile
index a14a759c1f..af175d2097 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -251,6 +251,7 @@ OBJS-$(CONFIG_HCOM_DEMUXER)  += hcom.o pcm.o
 OBJS-$(CONFIG_HDS_MUXER) += hdsenc.o
 OBJS-$(CONFIG_HEVC_DEMUXER)  += hevcdec.o rawdec.o
 OBJS-$(CONFIG_HEVC_MUXER)+= rawenc.o
+OBJS-$(CONFIG_EVC_DEMUXER)   += evcdec.o rawdec.o
 OBJS-$(CONFIG_EVC_MUXER) += rawenc.o
 OBJS-$(CONFIG_HLS_DEMUXER)   += hls.o hls_sample_encryption.o
 OBJS-$(CONFIG_HLS_MUXER) += hlsenc.o hlsplaylist.o avc.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index aabc9b5f99..a963c0223d 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -153,6 +153,7 @@ extern const AVInputFormat  ff_ea_cdata_demuxer;
 extern const AVInputFormat  ff_eac3_demuxer;
 extern const AVOutputFormat ff_eac3_muxer;
 extern const AVInputFormat  ff_epaf_demuxer;
+extern const AVInputFormat  ff_evc_demuxer;
 extern const AVOutputFormat ff_evc_muxer;
 extern const AVOutputFormat ff_f4v_muxer;
 extern const AVInputFormat  ff_ffmetadata_demuxer;
diff --git a/libavformat/evcdec.c b/libavformat/evcdec.c
new file mode 100644
index 00..7887f0b591
--- /dev/null
+++ b/libavformat/evcdec.c
@@ -0,0 +1,124 @@
+/*
+ * RAW EVC video demuxer
+ *
+ * Copyright (c) 2021 Dawid Kozinski 
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavcodec/get_bits.h"
+#include "libavcodec/golomb.h"
+#include "libavcodec/internal.h"
+#include "libavcodec/evc.h"
+
+#include "rawdec.h"
+#include "avformat.h"
+
+typedef struct EVCParserContext {
+int got_sps;
+int got_pps;
+int got_idr;
+int got_nonidr;
+} EVCParserContext;
+
+static int get_nalu_type(const uint8_t *bits, int bits_size)
+{
+int unit_type_plus1 = 0;
+
+if (bits_size >= EVC_NALU_HEADER_SIZE) {
+unsigned char *p = (unsigned char *)bits;
+// forbidden_zero_bit
+if ((p[0] & 0x80) != 0) { // Cannot get bitstream information. 
Malformed bitstream.
+return -1;
+}
+
+// nal_unit_type
+unit_type_plus1 = (p[0] >> 1) & 0x3F;
+}
+
+return unit_type_plus1 - 1;
+}
+
+static uint32_t read_nal_unit_length(const uint8_t *bits, int bits_size)
+{
+uint32_t nalu_len = 0;
+
+if (bits_size >= EVC_NALU_LENGTH_PREFIX_SIZE) {
+
+int t = 0;
+unsigned char *p = (unsigned char *)bits;
+
+for (int i=0; ibuf;
+int bytes_to_read = p->buf_size;
+
+while (bytes_to_read > EVC_NALU_LENGTH_PREFIX_SIZE) {
+
+nalu_size = read_nal_unit_length(bits, EVC_NALU_LENGTH_PREFIX_SIZE);
+if (nalu_size == 0) break;
+
+bits += EVC_NALU_LENGTH_PREFIX_SIZE;
+bytes_to_read -= EVC_NALU_LENGTH_PREFIX_SIZE;
+
+if(bytes_to_read < nalu_size) break;
+
+nalu_type = get_nalu_type(bits, bytes_to_read);
+
+bits += nalu_size;
+bytes_to_read -= nalu_size;
+
+if (nalu_type == EVC_SPS_NUT)
+ev->got_sps++;
+else if (nalu_type == EVC_PPS_NUT)
+ev->got_pps++;
+else if (nalu_type == EVC_IDR_NUT )
+ev->got_idr++;
+else if (nalu_type == EVC_NOIDR_NUT)
+ev->got_nonidr++;
+}
+
+return 0;
+}
+
+static int evc_probe(const AVProbeData *p)
+{
+EVCParserContext ev = {0};
+int ret = parse_nal_units(p, );
+
+if (ret == 0 && ev.got_sps && ev.got_pps && (ev.got_idr || ev.got_nonidr > 
3))
+return AVPROBE_SCORE_EXTENSION + 1;  // 1 more than .mpg
+
+return 0;
+}
+
+FF_DEF_RAWVIDEO_DEMUXER(evc, "raw EVC video", evc_probe, "evc", 
AV_CODEC_ID_EVC)
-- 
2.17.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, 

[FFmpeg-devel] [PATCH v15 3/9] avformat/evc_muxer: Added muxer to handle writing EVC encoded data into file or output bytestream

2022-12-14 Thread Dawid Kozinski
- Provided AVOutputFormat structure describing EVC output format (ff_evc_muxer)
- Added documentation for EVC muxer

Signed-off-by: Dawid Kozinski 
---
 doc/muxers.texi  |  6 ++
 libavformat/Makefile |  1 +
 libavformat/allformats.c |  1 +
 libavformat/rawenc.c | 13 +
 4 files changed, 21 insertions(+)

diff --git a/doc/muxers.texi b/doc/muxers.texi
index 4edbb22b00..244b5acf7d 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -2126,6 +2126,12 @@ DTS Coherent Acoustics (DCA) audio.
 
 Dolby Digital Plus, also known as Enhanced AC-3, audio.
 
+@subsection evc
+
+MPEG-5 Essential Video Coding (EVC) / EVC / MPEG-5 Part 1 EVC video.
+
+Extensions: evc
+
 @subsection g722
 
 ITU-T G.722 audio.
diff --git a/libavformat/Makefile b/libavformat/Makefile
index d7f198bf39..a14a759c1f 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -251,6 +251,7 @@ OBJS-$(CONFIG_HCOM_DEMUXER)  += hcom.o pcm.o
 OBJS-$(CONFIG_HDS_MUXER) += hdsenc.o
 OBJS-$(CONFIG_HEVC_DEMUXER)  += hevcdec.o rawdec.o
 OBJS-$(CONFIG_HEVC_MUXER)+= rawenc.o
+OBJS-$(CONFIG_EVC_MUXER) += rawenc.o
 OBJS-$(CONFIG_HLS_DEMUXER)   += hls.o hls_sample_encryption.o
 OBJS-$(CONFIG_HLS_MUXER) += hlsenc.o hlsplaylist.o avc.o
 OBJS-$(CONFIG_HNM_DEMUXER)   += hnm.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 62262ae935..aabc9b5f99 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -153,6 +153,7 @@ extern const AVInputFormat  ff_ea_cdata_demuxer;
 extern const AVInputFormat  ff_eac3_demuxer;
 extern const AVOutputFormat ff_eac3_muxer;
 extern const AVInputFormat  ff_epaf_demuxer;
+extern const AVOutputFormat ff_evc_muxer;
 extern const AVOutputFormat ff_f4v_muxer;
 extern const AVInputFormat  ff_ffmetadata_demuxer;
 extern const AVOutputFormat ff_ffmetadata_muxer;
diff --git a/libavformat/rawenc.c b/libavformat/rawenc.c
index 267fce252d..b7b2aff453 100644
--- a/libavformat/rawenc.c
+++ b/libavformat/rawenc.c
@@ -401,6 +401,19 @@ const AVOutputFormat ff_hevc_muxer = {
 };
 #endif
 
+#if CONFIG_EVC_MUXER
+AVOutputFormat ff_evc_muxer = {
+.name  = "evc",
+.long_name = NULL_IF_CONFIG_SMALL("raw EVC video"),
+.extensions= "evc",
+.audio_codec   = AV_CODEC_ID_NONE,
+.video_codec   = AV_CODEC_ID_EVC,
+.write_header  = force_one_stream,
+.write_packet  = ff_raw_write_packet,
+.flags = AVFMT_NOTIMESTAMPS,
+};
+#endif
+
 #if CONFIG_M4V_MUXER
 const AVOutputFormat ff_m4v_muxer = {
 .name  = "m4v",
-- 
2.17.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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v3] avformat/movenc: correct write_colr warning placement

2022-12-14 Thread Gyan Doshi
The old warning is no longer applicable in the inner block after
c5b20cfe19.
---
 libavformat/movenc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 7b00e65cdd..c427109609 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2330,10 +2330,11 @@ static int mov_write_video_tag(AVFormatContext *s, 
AVIOContext *pb, MOVMuxContex
 av_stream_get_side_data(track->st, AV_PKT_DATA_ICC_PROFILE, NULL)) 
{
 int prefer_icc = mov->flags & FF_MOV_FLAG_PREFER_ICC || 
!has_color_info;
 mov_write_colr_tag(pb, track, prefer_icc);
-} else if (mov->flags & FF_MOV_FLAG_WRITE_COLR) {
- av_log(mov->fc, AV_LOG_WARNING, "Not writing 'colr' atom. Format 
is not MOV or MP4.\n");
 }
+} else if (mov->flags & FF_MOV_FLAG_WRITE_COLR) {
+av_log(mov->fc, AV_LOG_WARNING, "Not writing 'colr' atom. Format 
is not MOV or MP4 or AVIF.\n");
 }
+
 if (track->mode == MODE_MOV || track->mode == MODE_MP4) {
 mov_write_clli_tag(pb, track);
 mov_write_mdcv_tag(pb, track);
-- 
2.36.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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v15 2/9] avcodec/evc_parser: Added parser implementation for EVC format

2022-12-14 Thread Dawid Kozinski
Signed-off-by: Dawid Kozinski 
---
 libavcodec/Makefile |1 +
 libavcodec/evc.h|  155 +
 libavcodec/evc_parser.c | 1417 +++
 libavcodec/parsers.c|1 +
 4 files changed, 1574 insertions(+)
 create mode 100644 libavcodec/evc.h
 create mode 100644 libavcodec/evc_parser.c

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 98841ed07c..401d0b7310 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -1146,6 +1146,7 @@ OBJS-$(CONFIG_DVAUDIO_PARSER)  += dvaudio_parser.o
 OBJS-$(CONFIG_DVBSUB_PARSER)   += dvbsub_parser.o
 OBJS-$(CONFIG_DVD_NAV_PARSER)  += dvd_nav_parser.o
 OBJS-$(CONFIG_DVDSUB_PARSER)   += dvdsub_parser.o
+OBJS-$(CONFIG_EVC_PARSER)  += evc_parser.o
 OBJS-$(CONFIG_FLAC_PARSER) += flac_parser.o flacdata.o flac.o
 OBJS-$(CONFIG_FTR_PARSER)  += ftr_parser.o
 OBJS-$(CONFIG_G723_1_PARSER)   += g723_1_parser.o
diff --git a/libavcodec/evc.h b/libavcodec/evc.h
new file mode 100644
index 00..d1fdb4fac6
--- /dev/null
+++ b/libavcodec/evc.h
@@ -0,0 +1,155 @@
+/*
+ * EVC definitions and enums
+ * Copyright (c) 2022 Dawid Kozinski 
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_EVC_H
+#define AVCODEC_EVC_H
+
+// The length field that indicates the length in bytes of the following NAL 
unit is configured to be of 4 bytes
+#define EVC_NALU_LENGTH_PREFIX_SIZE (4)  /* byte */
+#define EVC_NALU_HEADER_SIZE(2)  /* byte */
+
+/**
+ * @see ISO_IEC_23094-1_2020, 7.4.2.2 NAL unit header semantic
+ *  Table 4 - NAL unit type codes and NAL unit type classes
+ */
+enum EVCNALUnitType {
+EVC_NOIDR_NUT= 0,   /* Coded slice of a non-IDR picture */
+EVC_IDR_NUT  = 1,   /* Coded slice of an IDR picture */
+EVC_RSV_VCL_NUT02= 2,
+EVC_RSV_VCL_NUT03= 3,
+EVC_RSV_VCL_NUT04= 4,
+EVC_RSV_VCL_NUT05= 5,
+EVC_RSV_VCL_NUT06= 6,
+EVC_RSV_VCL_NUT07= 7,
+EVC_RSV_VCL_NUT08= 8,
+EVC_RSV_VCL_NUT09= 9,
+EVC_RSV_VCL_NUT10= 10,
+EVC_RSV_VCL_NUT11= 11,
+EVC_RSV_VCL_NUT12= 12,
+EVC_RSV_VCL_NUT13= 13,
+EVC_RSV_VCL_NUT14= 14,
+EVC_RSV_VCL_NUT15= 15,
+EVC_RSV_VCL_NUT16= 16,
+EVC_RSV_VCL_NUT17= 17,
+EVC_RSV_VCL_NUT18= 18,
+EVC_RSV_VCL_NUT19= 19,
+EVC_RSV_VCL_NUT20= 20,
+EVC_RSV_VCL_NUT21= 21,
+EVC_RSV_VCL_NUT22= 22,
+EVC_RSV_VCL_NUT23= 23,
+EVC_SPS_NUT  = 24,  /* Sequence parameter set */
+EVC_PPS_NUT  = 25,  /* Picture paremeter set */
+EVC_APS_NUT  = 26,  /* Adaptation parameter set */
+EVC_FD_NUT   = 27,  /* Filler data */
+EVC_SEI_NUT  = 28,  /* Supplemental enhancement information */
+EVC_RSV_NONVCL29 = 29,
+EVC_RSV_NONVCL30 = 30,
+EVC_RSV_NONVCL31 = 31,
+EVC_RSV_NONVCL32 = 32,
+EVC_RSV_NONVCL33 = 33,
+EVC_RSV_NONVCL34 = 34,
+EVC_RSV_NONVCL35 = 35,
+EVC_RSV_NONVCL36 = 36,
+EVC_RSV_NONVCL37 = 37,
+EVC_RSV_NONVCL38 = 38,
+EVC_RSV_NONVCL39 = 39,
+EVC_RSV_NONVCL40 = 40,
+EVC_RSV_NONVCL41 = 41,
+EVC_RSV_NONVCL42 = 42,
+EVC_RSV_NONVCL43 = 43,
+EVC_RSV_NONVCL44 = 44,
+EVC_RSV_NONVCL45 = 45,
+EVC_RSV_NONVCL46 = 46,
+EVC_RSV_NONVCL47 = 47,
+EVC_RSV_NONVCL48 = 48,
+EVC_RSV_NONVCL49 = 49,
+EVC_RSV_NONVCL50 = 50,
+EVC_RSV_NONVCL51 = 51,
+EVC_RSV_NONVCL52 = 52,
+EVC_RSV_NONVCL53 = 53,
+EVC_RSV_NONVCL54 = 54,
+EVC_RSV_NONVCL55 = 55,
+EVC_UNSPEC_NUT56 = 56,
+EVC_UNSPEC_NUT57 = 57,
+EVC_UNSPEC_NUT58 = 58,
+EVC_UNSPEC_NUT59 = 59,
+EVC_UNSPEC_NUT60 = 60,
+EVC_UNSPEC_NUT61 = 61,
+EVC_UNSPEC_NUT62 = 62
+};
+
+// slice type
+// @see ISO_IEC_23094-1_2020 7.4.5 Slice header semantics

[FFmpeg-devel] [PATCH v15 1/9] avcodec/evc: MPEG-5 EVC codec registration

2022-12-14 Thread Dawid Kozinski
Added prerequisites that must be met before providing support for the MPEG-5 
EVC codec
- Added new entry to codec IDs list
- Added new entry to the codec descriptor list
- Bumped libavcodec minor version
- Added profiles for EVC codec

Signed-off-by: Dawid Kozinski 
---
 libavcodec/avcodec.h| 3 +++
 libavcodec/codec_desc.c | 8 
 libavcodec/codec_id.h   | 1 +
 libavcodec/profiles.c   | 6 ++
 libavcodec/profiles.h   | 1 +
 libavcodec/version.h| 2 +-
 6 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 0ac581d660..39296021c4 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1668,6 +1668,9 @@ typedef struct AVCodecContext {
 #define FF_PROFILE_KLVA_SYNC 0
 #define FF_PROFILE_KLVA_ASYNC 1
 
+#define FF_PROFILE_EVC_BASELINE 0
+#define FF_PROFILE_EVC_MAIN 1
+
 /**
  * level
  * - encoding: Set by user.
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 24a0433dba..357e17d82c 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1923,6 +1923,14 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .long_name = NULL_IF_CONFIG_SMALL("ViewQuest VQC"),
 .props = AV_CODEC_PROP_LOSSY,
 },
+{
+.id= AV_CODEC_ID_EVC,
+.type  = AVMEDIA_TYPE_VIDEO,
+.name  = "evc",
+.long_name = NULL_IF_CONFIG_SMALL("MPEG-5 EVC (Essential Video 
Coding)"),
+.props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER,
+.profiles  = NULL_IF_CONFIG_SMALL(ff_evc_profiles),
+},
 
 /* various PCM "codecs" */
 {
diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h
index f436a2b624..b887a3788f 100644
--- a/libavcodec/codec_id.h
+++ b/libavcodec/codec_id.h
@@ -320,6 +320,7 @@ enum AVCodecID {
 AV_CODEC_ID_WBMP,
 AV_CODEC_ID_MEDIA100,
 AV_CODEC_ID_VQC,
+AV_CODEC_ID_EVC,
 
 /* various PCM "codecs" */
 AV_CODEC_ID_FIRST_AUDIO = 0x1, ///< A dummy id pointing at the 
start of audio codecs
diff --git a/libavcodec/profiles.c b/libavcodec/profiles.c
index 7af7fbeb13..a31244e0db 100644
--- a/libavcodec/profiles.c
+++ b/libavcodec/profiles.c
@@ -181,4 +181,10 @@ const AVProfile ff_arib_caption_profiles[] = {
 { FF_PROFILE_UNKNOWN }
 };
 
+const AVProfile ff_evc_profiles[] = {
+{ FF_PROFILE_EVC_BASELINE, "Baseline"  },
+{ FF_PROFILE_EVC_MAIN, "Main"  },
+{ FF_PROFILE_UNKNOWN },
+};
+
 #endif /* !CONFIG_SMALL */
diff --git a/libavcodec/profiles.h b/libavcodec/profiles.h
index 41a19aa9ad..cf92b5f126 100644
--- a/libavcodec/profiles.h
+++ b/libavcodec/profiles.h
@@ -72,5 +72,6 @@ extern const AVProfile ff_sbc_profiles[];
 extern const AVProfile ff_prores_profiles[];
 extern const AVProfile ff_mjpeg_profiles[];
 extern const AVProfile ff_arib_caption_profiles[];
+extern const AVProfile ff_evc_profiles[];
 
 #endif /* AVCODEC_PROFILES_H */
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 9f42f09f4e..6b8a1dbb79 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 
 #include "version_major.h"
 
-#define LIBAVCODEC_VERSION_MINOR  55
+#define LIBAVCODEC_VERSION_MINOR  56
 #define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
-- 
2.17.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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v2] avformat/movenc: remove write_colr warning

2022-12-14 Thread zhilizhao(赵志立)


> On Dec 14, 2022, at 18:51, Gyan Doshi  wrote:
> 
> 
> On 2022-12-12 10:11 am, Gyan Doshi wrote:
>> The old warning is no longer applicable after this block was recomposed in
>> c5b20cfe19. The block is only active for supported formats.
> 
> Plan to push tomorrow.
> 
> 
>> ---
>>  libavformat/movenc.c | 2 --
>>  1 file changed, 2 deletions(-)
>> 
>> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
>> index 7b00e65cdd..d1bef25147 100644
>> --- a/libavformat/movenc.c
>> +++ b/libavformat/movenc.c
>> @@ -2330,8 +2330,6 @@ static int mov_write_video_tag(AVFormatContext *s, 
>> AVIOContext *pb, MOVMuxContex
>>  av_stream_get_side_data(track->st, AV_PKT_DATA_ICC_PROFILE, 
>> NULL)) {
>>  int prefer_icc = mov->flags & FF_MOV_FLAG_PREFER_ICC || 
>> !has_color_info;
>>  mov_write_colr_tag(pb, track, prefer_icc);
>> -} else if (mov->flags & FF_MOV_FLAG_WRITE_COLR) {
>> - av_log(mov->fc, AV_LOG_WARNING, "Not writing 'colr' atom. 
>> Format is not MOV or MP4.\n");
>>  }
>>  }

Rather than remove the code block, I think the ‘else if’ should be paired with 
the outer ‘if’.

>>  if (track->mode == MODE_MOV || track->mode == MODE_MP4) {
> 
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH]configure: Assume target-os=win32 for toolchain msvc

2022-12-14 Thread Carl Eugen Hoyos
Am Mi., 14. Dez. 2022 um 00:43 Uhr schrieb Timo Rothenpieler
:
>
> On 13.12.2022 20:00, Carl Eugen Hoyos wrote:
> > Ping.
> > Could you give an example where host-os is not win32 when
> > compiling with msvc?
>
> WSL, which I quite regularly use to test MSVC builds.
> Just need to launch it from inside an msvc shell.

This is the bug that my patch is trying to fix:
When you build with msvc in wsl, you are doing a native build on win32.
I want to avoid the "--host-os=win32" for this case.

I had not imagined an msvc build using wine on Linux.

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v2] avformat/movenc: remove write_colr warning

2022-12-14 Thread Gyan Doshi




On 2022-12-12 10:11 am, Gyan Doshi wrote:

The old warning is no longer applicable after this block was recomposed in
c5b20cfe19. The block is only active for supported formats.


Plan to push tomorrow.



---
  libavformat/movenc.c | 2 --
  1 file changed, 2 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 7b00e65cdd..d1bef25147 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2330,8 +2330,6 @@ static int mov_write_video_tag(AVFormatContext *s, 
AVIOContext *pb, MOVMuxContex
  av_stream_get_side_data(track->st, AV_PKT_DATA_ICC_PROFILE, 
NULL)) {
  int prefer_icc = mov->flags & FF_MOV_FLAG_PREFER_ICC || 
!has_color_info;
  mov_write_colr_tag(pb, track, prefer_icc);
-} else if (mov->flags & FF_MOV_FLAG_WRITE_COLR) {
- av_log(mov->fc, AV_LOG_WARNING, "Not writing 'colr' atom. Format is 
not MOV or MP4.\n");
  }
  }
  if (track->mode == MODE_MOV || track->mode == MODE_MP4) {


___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".