Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
> On May 9, 2016, at 08:28, Hendrik Leppkes wrote: > > On Mon, May 9, 2016 at 3:26 PM, Derek Buitenhuis > wrote: >> On 5/9/2016 2:22 PM, Paul B Mahol wrote: >>> Once st->codec is gone, how would this lossless info be gathered back? >> >> As myself and others have said above: decode a frame. > > And before people argue that avformat does this anyway today - one of > the hopes is to make it stop doing that for many "simple" codecs where > this is just not necessary, and say a parser could extract all the > important information with much less overhead. (necroing old thread because this came up elsewhere) I can understand the argument that lavf shouldn't return all of this by _default_, but not providing a mechanism at all forces a lot of additional boilerplate onto the consumer. It'd be convenient to have an API that does the equivalent of what avformat_find_stream_info currently does (determine all relevant stream information for all streams, either using parsers or decoders as necessary, running through as many frames as necessary to gather the info, up to timestamp- and size-based limits). If you don't think this fits well in lavf, there could be a higher-level lib on top of lavf+lavc that handles this sort of thing (potentially the "ffmpeg.c-as-a-library" concept I've thought about for a while, with ffprobe-like functionality as well), but the simplest way to do it is just to have avformat_find_stream_info continue to perform that function, perhaps behind a "gather more info than what lavf itself needs" flag. > > - Hendrik > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
On Mon, May 09, 2016 at 02:29:50PM +0200, Michael Niedermayer wrote: > On Sun, May 08, 2016 at 05:42:13PM +0200, Hendrik Leppkes wrote: > > On Sun, May 8, 2016 at 5:33 PM, Michael Niedermayer > > wrote: > > > On Sun, May 08, 2016 at 04:10:01PM +0200, wm4 wrote: > > >> On Sun, 8 May 2016 12:10:07 +0200 > > >> Michael Niedermayer wrote: > > >> > > >> > Fixes Ticket5467 > > >> > > > >> > Signed-off-by: Michael Niedermayer > > >> > --- > > >> > libavcodec/avcodec.h |4 > > >> > libavcodec/utils.c |2 ++ > > >> > 2 files changed, 6 insertions(+) > > >> > > > >> > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h > > >> > index 3813a0a..1db2e0f 100644 > > >> > --- a/libavcodec/avcodec.h > > >> > +++ b/libavcodec/avcodec.h > > >> > @@ -4050,6 +4050,10 @@ typedef struct AVCodecParameters { > > >> > * Audio only. Number of samples to skip after a discontinuity. > > >> > */ > > >> > int seek_preroll; > > >> > + > > >> > +/** Properties, like FF_CODEC_PROPERTY_LOSSLESS. > > >> > + */ > > >> > +int properties; > > >> > } AVCodecParameters; > > >> > > > >> > /** > > >> > diff --git a/libavcodec/utils.c b/libavcodec/utils.c > > >> > index e6609ef..8638bc2 100644 > > >> > --- a/libavcodec/utils.c > > >> > +++ b/libavcodec/utils.c > > >> > @@ -4076,6 +4076,7 @@ int > > >> > avcodec_parameters_from_context(AVCodecParameters *par, > > >> > par->bits_per_raw_sample = codec->bits_per_raw_sample; > > >> > par->profile = codec->profile; > > >> > par->level = codec->level; > > >> > +par->properties= codec->properties; > > >> > > > >> > switch (par->codec_type) { > > >> > case AVMEDIA_TYPE_VIDEO: > > >> > @@ -4130,6 +4131,7 @@ int avcodec_parameters_to_context(AVCodecContext > > >> > *codec, > > >> > codec->bits_per_raw_sample = par->bits_per_raw_sample; > > >> > codec->profile = par->profile; > > >> > codec->level = par->level; > > >> > +codec->properties= par->properties; > > >> > > > >> > switch (par->codec_type) { > > >> > case AVMEDIA_TYPE_VIDEO: > > >> > > >> Can you explain what exactly this is needed for? > > > > > > User apps can with this identify which streams are lossless without > > > them needing to open decoders for each stream and explicitly decode > > > some frames for each stream. > > > > > > it fixes a regression where this information is incorrectly printed > > > by av_dump_format() > > > > > > it fixes a regression where the existing lossless flag as documented by > > > the current documentation is set incorrectly > > > > > > > We can copy it to the deprecated st->codec to keep the existing things > > working, but it still remains not a container flag, and the purpose of > > this structure is not to export every single piece of information a > > decoder might output. > > this can be done but then dump_stream_format() would also need to move > back to using the deprecated struct (for that field at least) instead > of just codec par, not sure thats the only function thats affected ... question to all: should i work on / implement above ? [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Opposition brings concord. Out of discord comes the fairest harmony. -- Heraclitus signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
On Mon, May 16, 2016 at 4:43 AM, James Almer wrote: > On 5/8/2016 12:18 PM, Hendrik Leppkes wrote: >> On Sun, May 8, 2016 at 12:10 PM, Michael Niedermayer >> wrote: >>> Fixes Ticket5467 >>> >>> Signed-off-by: Michael Niedermayer >>> --- >>> libavcodec/avcodec.h |4 >>> libavcodec/utils.c |2 ++ >>> 2 files changed, 6 insertions(+) >>> >>> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h >>> index 3813a0a..1db2e0f 100644 >>> --- a/libavcodec/avcodec.h >>> +++ b/libavcodec/avcodec.h >>> @@ -4050,6 +4050,10 @@ typedef struct AVCodecParameters { >>> * Audio only. Number of samples to skip after a discontinuity. >>> */ >>> int seek_preroll; >>> + >>> +/** Properties, like FF_CODEC_PROPERTY_LOSSLESS. >>> + */ >>> +int properties; >>> } AVCodecParameters; >>> >> >> There properties are not part of any container we support and therefor >> not really fitting into this structure. >> >> - Hendrik > > Guess i'm late to the party, but we support the DTS-HD container and it has a > field that reports if the stream is lossless or not. > See > http://atsc.org/wp-content/uploads/2015/03/Non-Real-Time-Content-Delivery.pdf > section E.2.8 and table E.12, Bitw_Aupres_Metadata field. > DTS-HD has profiles to express this though, it doesn't need such a flag. And I would argue maybe other codecs should also use profiles to differentiate different codec modes. - Hendrik ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
On 5/8/2016 12:18 PM, Hendrik Leppkes wrote: > On Sun, May 8, 2016 at 12:10 PM, Michael Niedermayer > wrote: >> Fixes Ticket5467 >> >> Signed-off-by: Michael Niedermayer >> --- >> libavcodec/avcodec.h |4 >> libavcodec/utils.c |2 ++ >> 2 files changed, 6 insertions(+) >> >> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h >> index 3813a0a..1db2e0f 100644 >> --- a/libavcodec/avcodec.h >> +++ b/libavcodec/avcodec.h >> @@ -4050,6 +4050,10 @@ typedef struct AVCodecParameters { >> * Audio only. Number of samples to skip after a discontinuity. >> */ >> int seek_preroll; >> + >> +/** Properties, like FF_CODEC_PROPERTY_LOSSLESS. >> + */ >> +int properties; >> } AVCodecParameters; >> > > There properties are not part of any container we support and therefor > not really fitting into this structure. > > - Hendrik Guess i'm late to the party, but we support the DTS-HD container and it has a field that reports if the stream is lossless or not. See http://atsc.org/wp-content/uploads/2015/03/Non-Real-Time-Content-Delivery.pdf section E.2.8 and table E.12, Bitw_Aupres_Metadata field. For that matter I'll submit a patch soon to read some fields from this header to get stream duration and bitrate since libavformat currently reports neither. Assuming this properties field is added to AVCodecParameters it could be used to report the losslessness of the stream as well. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
On Mon, May 09, 2016 at 01:44:54PM +0100, Derek Buitenhuis wrote: > On 5/9/2016 1:29 PM, Michael Niedermayer wrote: > > Also theres a deeper problem, > > User want, benefit from and sometimes need, "every single piece of > > information a decoder might output.", well not "every" of course > > but its hard to draw lines what may be needed and what not. > > They can decode a frame like the rest of us. This does not belong > in a demuxing library IMO. The problem (or rather one problem, there might be more) that this is about is a user application selecting which stream to play like users might prefer higher quality streams or lossless streams For width/height/sample rate the information is straight available for quality a user app has to setup a array of packet buffers decode frames until the quality parameter is filled in and have logic to detect containers and codecs which do never fill it thresholds to stop, also to recover from error conditions liek EOF and still be able to play a stream which at the same time maybe isnt seekable and on top of that user apps would have to do that even though libavformat does exactly the same already to fill other information in cases where it is needed basically in the past user apps had the full set of information available to select which stream to present to the user or to present the user with a list of choices. after codec par user apps only have a subset of this information available and if they want more they need to more or less reimplement av_find_stream_info() Its that reimplementation need that really feels wrong to me. There should be some API in some lib that does this so not every app needs to reimplement it for obtaining information like losslessness [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I know you won't believe me, but the highest form of Human Excellence is to question oneself and others. -- Socrates signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
On Mon, 9 May 2016 15:28:11 +0200 Hendrik Leppkes wrote: > On Mon, May 9, 2016 at 3:26 PM, Derek Buitenhuis > wrote: > > On 5/9/2016 2:22 PM, Paul B Mahol wrote: > >> Once st->codec is gone, how would this lossless info be gathered back? > > > > As myself and others have said above: decode a frame. > > And before people argue that avformat does this anyway today - one of > the hopes is to make it stop doing that for many "simple" codecs where > this is just not necessary, and say a parser could extract all the > important information with much less overhead. +1, that would be nice. I think there should perhaps be a better solution to what libavformat traditionally tried to do. On the command line, ffprobe could be used to dump exact and detailed information about decoded frames. On the ffmpeg.c level, it actually should decode a frame, which would solve a bunch of problems, including those that can't be solved by the traditional libavformat model. (Such as changing parameters due to hardware decoding.) av_dump_format() should be constrained to demuxer information. (Just change its output.) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
On 5/9/2016 2:28 PM, Hendrik Leppkes wrote: > And before people argue that avformat does this anyway today - one of > the hopes is to make it stop doing that for many "simple" codecs where > this is just not necessary, and say a parser could extract all the > important information with much less overhead. I wasn't actually aware of that, but it would be really nice to have faster init because of this. Cool. - Derek ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
On Mon, May 9, 2016 at 3:26 PM, Derek Buitenhuis wrote: > On 5/9/2016 2:22 PM, Paul B Mahol wrote: >> Once st->codec is gone, how would this lossless info be gathered back? > > As myself and others have said above: decode a frame. And before people argue that avformat does this anyway today - one of the hopes is to make it stop doing that for many "simple" codecs where this is just not necessary, and say a parser could extract all the important information with much less overhead. - Hendrik ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
On 5/9/2016 2:22 PM, Paul B Mahol wrote: > Once st->codec is gone, how would this lossless info be gathered back? As myself and others have said above: decode a frame. It is not a demuxer's job to provide info gleaned from decoding. Either avformat should be properly separate as it (kind of) is now, and provide info required for demuxing and muxing the containers it supports, or it should be merged into libavcodec like Nicholas wants, and it can provide both. Doing a little of both for random fields, and keeping them as separate libraries is just awful, though. - Derek ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
On 5/9/16, Derek Buitenhuis wrote: > On 5/9/2016 2:19 PM, Paul B Mahol wrote: >> Isn't st->codec deprecated? > > It is, but the old behavior should be maintained for the duration > of its deprecation period. It's a bug not to add it back to st->codec > in my opinion. Once st->codec is gone, how would this lossless info be gathered back? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
On 5/9/2016 2:19 PM, Paul B Mahol wrote: > Isn't st->codec deprecated? It is, but the old behavior should be maintained for the duration of its deprecation period. It's a bug not to add it back to st->codec in my opinion. - Derek ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
On 5/9/16, Derek Buitenhuis wrote: > On 5/9/2016 1:52 PM, Carl Eugen Hoyos wrote: >> So can you answer why the codec aspect ratio is provided but >> other information is not? > > Most because e.g. some *conatiners* need this info. No containers, to my > knowledge, need this 'lossless' info. > >> Do you agree that the answer is that decoders need this >> information? > > The decoders definitely *do not* need this lossless info. It's workaround > for a purely cosmetic problem with assumptions a CLI tool used to make. > > IMO the correct 'fix' is to add it back to st->codec like others suggested, > for the time being. Isn't st->codec deprecated? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
On 5/9/2016 1:52 PM, Carl Eugen Hoyos wrote: > So can you answer why the codec aspect ratio is provided but > other information is not? Most because e.g. some *conatiners* need this info. No containers, to my knowledge, need this 'lossless' info. > Do you agree that the answer is that decoders need this > information? The decoders definitely *do not* need this lossless info. It's workaround for a purely cosmetic problem with assumptions a CLI tool used to make. IMO the correct 'fix' is to add it back to st->codec like others suggested, for the time being. - Derek ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
On 5/9/2016 1:48 PM, Carl Eugen Hoyos wrote: > This should get applied asap imo. NAK! This patch has at least 3 people dissenting and it doesn't actually "fix" anything except cosmetic output on the console, which is NOT meant to be parsed not even stable. > Arguing that the frame should be decoded a second time to > get the information seems like a good argument in favour > of this patch. No. This is an API and ABI level change, to fix cosmetic output of a CLI tool. - Derek ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
Derek Buitenhuis gmail.com> writes: > It's not reasonable to expect a *demuxer* to provide decoder info. So can you answer why the codec aspect ratio is provided but other information is not? Do you agree that the answer is that decoders need this information? Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
Michael Niedermayer niedermayer.cc> writes: > Fixes Ticket5467 This should get applied asap imo. Arguing that the frame should be decoded a second time to get the information seems like a good argument in favour of this patch. Thank you for trying to help, Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
On 5/9/2016 8:36 AM, wm4 wrote: > I'd argue that AVCodecParameters should contain only container > properties, or we'd end up with duplicating most of AVCodecContext in > it. Agreed. IMO the correct solution for user applications is to decode a frame. It's not reasonable to expect a *demuxer* to provide decoder info. - Derek ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
On 5/9/2016 1:29 PM, Michael Niedermayer wrote: > Also theres a deeper problem, > User want, benefit from and sometimes need, "every single piece of > information a decoder might output.", well not "every" of course > but its hard to draw lines what may be needed and what not. They can decode a frame like the rest of us. This does not belong in a demuxing library IMO. - Derek ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
On Sun, May 08, 2016 at 05:42:13PM +0200, Hendrik Leppkes wrote: > On Sun, May 8, 2016 at 5:33 PM, Michael Niedermayer > wrote: > > On Sun, May 08, 2016 at 04:10:01PM +0200, wm4 wrote: > >> On Sun, 8 May 2016 12:10:07 +0200 > >> Michael Niedermayer wrote: > >> > >> > Fixes Ticket5467 > >> > > >> > Signed-off-by: Michael Niedermayer > >> > --- > >> > libavcodec/avcodec.h |4 > >> > libavcodec/utils.c |2 ++ > >> > 2 files changed, 6 insertions(+) > >> > > >> > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h > >> > index 3813a0a..1db2e0f 100644 > >> > --- a/libavcodec/avcodec.h > >> > +++ b/libavcodec/avcodec.h > >> > @@ -4050,6 +4050,10 @@ typedef struct AVCodecParameters { > >> > * Audio only. Number of samples to skip after a discontinuity. > >> > */ > >> > int seek_preroll; > >> > + > >> > +/** Properties, like FF_CODEC_PROPERTY_LOSSLESS. > >> > + */ > >> > +int properties; > >> > } AVCodecParameters; > >> > > >> > /** > >> > diff --git a/libavcodec/utils.c b/libavcodec/utils.c > >> > index e6609ef..8638bc2 100644 > >> > --- a/libavcodec/utils.c > >> > +++ b/libavcodec/utils.c > >> > @@ -4076,6 +4076,7 @@ int > >> > avcodec_parameters_from_context(AVCodecParameters *par, > >> > par->bits_per_raw_sample = codec->bits_per_raw_sample; > >> > par->profile = codec->profile; > >> > par->level = codec->level; > >> > +par->properties= codec->properties; > >> > > >> > switch (par->codec_type) { > >> > case AVMEDIA_TYPE_VIDEO: > >> > @@ -4130,6 +4131,7 @@ int avcodec_parameters_to_context(AVCodecContext > >> > *codec, > >> > codec->bits_per_raw_sample = par->bits_per_raw_sample; > >> > codec->profile = par->profile; > >> > codec->level = par->level; > >> > +codec->properties= par->properties; > >> > > >> > switch (par->codec_type) { > >> > case AVMEDIA_TYPE_VIDEO: > >> > >> Can you explain what exactly this is needed for? > > > > User apps can with this identify which streams are lossless without > > them needing to open decoders for each stream and explicitly decode > > some frames for each stream. > > > > it fixes a regression where this information is incorrectly printed > > by av_dump_format() > > > > it fixes a regression where the existing lossless flag as documented by > > the current documentation is set incorrectly > > > > We can copy it to the deprecated st->codec to keep the existing things > working, but it still remains not a container flag, and the purpose of > this structure is not to export every single piece of information a > decoder might output. this can be done but then dump_stream_format() would also need to move back to using the deprecated struct (for that field at least) instead of just codec par, not sure thats the only function thats affected ... Also theres a deeper problem, User want, benefit from and sometimes need, "every single piece of information a decoder might output.", well not "every" of course but its hard to draw lines what may be needed and what not. Having an API that provides this information without user apps needing to implement full data collection using low level APIs dealing with errors and unseekable protocols, ... should be quite useful [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I know you won't believe me, but the highest form of Human Excellence is to question oneself and others. -- Socrates signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
On Sun, 8 May 2016 17:33:32 +0200 Michael Niedermayer wrote: > On Sun, May 08, 2016 at 04:10:01PM +0200, wm4 wrote: > > On Sun, 8 May 2016 12:10:07 +0200 > > Michael Niedermayer wrote: > > > > > Fixes Ticket5467 > > > > > > Signed-off-by: Michael Niedermayer > > > --- > > > libavcodec/avcodec.h |4 > > > libavcodec/utils.c |2 ++ > > > 2 files changed, 6 insertions(+) > > > > > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h > > > index 3813a0a..1db2e0f 100644 > > > --- a/libavcodec/avcodec.h > > > +++ b/libavcodec/avcodec.h > > > @@ -4050,6 +4050,10 @@ typedef struct AVCodecParameters { > > > * Audio only. Number of samples to skip after a discontinuity. > > > */ > > > int seek_preroll; > > > + > > > +/** Properties, like FF_CODEC_PROPERTY_LOSSLESS. > > > + */ > > > +int properties; > > > } AVCodecParameters; > > > > > > /** > > > diff --git a/libavcodec/utils.c b/libavcodec/utils.c > > > index e6609ef..8638bc2 100644 > > > --- a/libavcodec/utils.c > > > +++ b/libavcodec/utils.c > > > @@ -4076,6 +4076,7 @@ int > > > avcodec_parameters_from_context(AVCodecParameters *par, > > > par->bits_per_raw_sample = codec->bits_per_raw_sample; > > > par->profile = codec->profile; > > > par->level = codec->level; > > > +par->properties= codec->properties; > > > > > > switch (par->codec_type) { > > > case AVMEDIA_TYPE_VIDEO: > > > @@ -4130,6 +4131,7 @@ int avcodec_parameters_to_context(AVCodecContext > > > *codec, > > > codec->bits_per_raw_sample = par->bits_per_raw_sample; > > > codec->profile = par->profile; > > > codec->level = par->level; > > > +codec->properties= par->properties; > > > > > > switch (par->codec_type) { > > > case AVMEDIA_TYPE_VIDEO: > > > > Can you explain what exactly this is needed for? > > User apps can with this identify which streams are lossless without > them needing to open decoders for each stream and explicitly decode > some frames for each stream. I'd argue that AVCodecParameters should contain only container properties, or we'd end up with duplicating most of AVCodecContext in it. > it fixes a regression where this information is incorrectly printed > by av_dump_format() > > it fixes a regression where the existing lossless flag as documented by > the current documentation is set incorrectly > > [...] > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
On Sun, May 08, 2016 at 05:18:40PM +0200, Hendrik Leppkes wrote: > On Sun, May 8, 2016 at 12:10 PM, Michael Niedermayer > wrote: > > Fixes Ticket5467 > > > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/avcodec.h |4 > > libavcodec/utils.c |2 ++ > > 2 files changed, 6 insertions(+) > > > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h > > index 3813a0a..1db2e0f 100644 > > --- a/libavcodec/avcodec.h > > +++ b/libavcodec/avcodec.h > > @@ -4050,6 +4050,10 @@ typedef struct AVCodecParameters { > > * Audio only. Number of samples to skip after a discontinuity. > > */ > > int seek_preroll; > > + > > +/** Properties, like FF_CODEC_PROPERTY_LOSSLESS. > > + */ > > +int properties; > > } AVCodecParameters; > > > > There properties are not part of any container we support and therefor > not really fitting into this structure. The documentation of AVCodecParameters says "This struct describes the properties of an encoded stream." lossless-ness is certainly a property of an encoded stream i dont think restricting a structure from libavcodec by the existence of demuxers for formats in libavformat is a good or clean design. its also not really true, that this isnt stored in containers avi for example has dwQuality which in conjunction with the codec_tag can probably be used to detect lossless ness for some codec_tags [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB it is not once nor twice but times without number that the same ideas make their appearance in the world. -- Aristotle signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
On Sun, May 8, 2016 at 5:33 PM, Michael Niedermayer wrote: > On Sun, May 08, 2016 at 04:10:01PM +0200, wm4 wrote: >> On Sun, 8 May 2016 12:10:07 +0200 >> Michael Niedermayer wrote: >> >> > Fixes Ticket5467 >> > >> > Signed-off-by: Michael Niedermayer >> > --- >> > libavcodec/avcodec.h |4 >> > libavcodec/utils.c |2 ++ >> > 2 files changed, 6 insertions(+) >> > >> > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h >> > index 3813a0a..1db2e0f 100644 >> > --- a/libavcodec/avcodec.h >> > +++ b/libavcodec/avcodec.h >> > @@ -4050,6 +4050,10 @@ typedef struct AVCodecParameters { >> > * Audio only. Number of samples to skip after a discontinuity. >> > */ >> > int seek_preroll; >> > + >> > +/** Properties, like FF_CODEC_PROPERTY_LOSSLESS. >> > + */ >> > +int properties; >> > } AVCodecParameters; >> > >> > /** >> > diff --git a/libavcodec/utils.c b/libavcodec/utils.c >> > index e6609ef..8638bc2 100644 >> > --- a/libavcodec/utils.c >> > +++ b/libavcodec/utils.c >> > @@ -4076,6 +4076,7 @@ int >> > avcodec_parameters_from_context(AVCodecParameters *par, >> > par->bits_per_raw_sample = codec->bits_per_raw_sample; >> > par->profile = codec->profile; >> > par->level = codec->level; >> > +par->properties= codec->properties; >> > >> > switch (par->codec_type) { >> > case AVMEDIA_TYPE_VIDEO: >> > @@ -4130,6 +4131,7 @@ int avcodec_parameters_to_context(AVCodecContext >> > *codec, >> > codec->bits_per_raw_sample = par->bits_per_raw_sample; >> > codec->profile = par->profile; >> > codec->level = par->level; >> > +codec->properties= par->properties; >> > >> > switch (par->codec_type) { >> > case AVMEDIA_TYPE_VIDEO: >> >> Can you explain what exactly this is needed for? > > User apps can with this identify which streams are lossless without > them needing to open decoders for each stream and explicitly decode > some frames for each stream. > > it fixes a regression where this information is incorrectly printed > by av_dump_format() > > it fixes a regression where the existing lossless flag as documented by > the current documentation is set incorrectly > We can copy it to the deprecated st->codec to keep the existing things working, but it still remains not a container flag, and the purpose of this structure is not to export every single piece of information a decoder might output. - Hendrik ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
On Sun, May 08, 2016 at 04:10:01PM +0200, wm4 wrote: > On Sun, 8 May 2016 12:10:07 +0200 > Michael Niedermayer wrote: > > > Fixes Ticket5467 > > > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/avcodec.h |4 > > libavcodec/utils.c |2 ++ > > 2 files changed, 6 insertions(+) > > > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h > > index 3813a0a..1db2e0f 100644 > > --- a/libavcodec/avcodec.h > > +++ b/libavcodec/avcodec.h > > @@ -4050,6 +4050,10 @@ typedef struct AVCodecParameters { > > * Audio only. Number of samples to skip after a discontinuity. > > */ > > int seek_preroll; > > + > > +/** Properties, like FF_CODEC_PROPERTY_LOSSLESS. > > + */ > > +int properties; > > } AVCodecParameters; > > > > /** > > diff --git a/libavcodec/utils.c b/libavcodec/utils.c > > index e6609ef..8638bc2 100644 > > --- a/libavcodec/utils.c > > +++ b/libavcodec/utils.c > > @@ -4076,6 +4076,7 @@ int avcodec_parameters_from_context(AVCodecParameters > > *par, > > par->bits_per_raw_sample = codec->bits_per_raw_sample; > > par->profile = codec->profile; > > par->level = codec->level; > > +par->properties= codec->properties; > > > > switch (par->codec_type) { > > case AVMEDIA_TYPE_VIDEO: > > @@ -4130,6 +4131,7 @@ int avcodec_parameters_to_context(AVCodecContext > > *codec, > > codec->bits_per_raw_sample = par->bits_per_raw_sample; > > codec->profile = par->profile; > > codec->level = par->level; > > +codec->properties= par->properties; > > > > switch (par->codec_type) { > > case AVMEDIA_TYPE_VIDEO: > > Can you explain what exactly this is needed for? User apps can with this identify which streams are lossless without them needing to open decoders for each stream and explicitly decode some frames for each stream. it fixes a regression where this information is incorrectly printed by av_dump_format() it fixes a regression where the existing lossless flag as documented by the current documentation is set incorrectly [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Let us carefully observe those good qualities wherein our enemies excel us and endeavor to excel them, by avoiding what is faulty, and imitating what is excellent in them. -- Plutarch signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
On Sun, May 8, 2016 at 12:10 PM, Michael Niedermayer wrote: > Fixes Ticket5467 > > Signed-off-by: Michael Niedermayer > --- > libavcodec/avcodec.h |4 > libavcodec/utils.c |2 ++ > 2 files changed, 6 insertions(+) > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h > index 3813a0a..1db2e0f 100644 > --- a/libavcodec/avcodec.h > +++ b/libavcodec/avcodec.h > @@ -4050,6 +4050,10 @@ typedef struct AVCodecParameters { > * Audio only. Number of samples to skip after a discontinuity. > */ > int seek_preroll; > + > +/** Properties, like FF_CODEC_PROPERTY_LOSSLESS. > + */ > +int properties; > } AVCodecParameters; > There properties are not part of any container we support and therefor not really fitting into this structure. - Hendrik ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
On Sun, 8 May 2016 12:10:07 +0200 Michael Niedermayer wrote: > Fixes Ticket5467 > > Signed-off-by: Michael Niedermayer > --- > libavcodec/avcodec.h |4 > libavcodec/utils.c |2 ++ > 2 files changed, 6 insertions(+) > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h > index 3813a0a..1db2e0f 100644 > --- a/libavcodec/avcodec.h > +++ b/libavcodec/avcodec.h > @@ -4050,6 +4050,10 @@ typedef struct AVCodecParameters { > * Audio only. Number of samples to skip after a discontinuity. > */ > int seek_preroll; > + > +/** Properties, like FF_CODEC_PROPERTY_LOSSLESS. > + */ > +int properties; > } AVCodecParameters; > > /** > diff --git a/libavcodec/utils.c b/libavcodec/utils.c > index e6609ef..8638bc2 100644 > --- a/libavcodec/utils.c > +++ b/libavcodec/utils.c > @@ -4076,6 +4076,7 @@ int avcodec_parameters_from_context(AVCodecParameters > *par, > par->bits_per_raw_sample = codec->bits_per_raw_sample; > par->profile = codec->profile; > par->level = codec->level; > +par->properties= codec->properties; > > switch (par->codec_type) { > case AVMEDIA_TYPE_VIDEO: > @@ -4130,6 +4131,7 @@ int avcodec_parameters_to_context(AVCodecContext *codec, > codec->bits_per_raw_sample = par->bits_per_raw_sample; > codec->profile = par->profile; > codec->level = par->level; > +codec->properties= par->properties; > > switch (par->codec_type) { > case AVMEDIA_TYPE_VIDEO: Can you explain what exactly this is needed for? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters
Fixes Ticket5467 Signed-off-by: Michael Niedermayer --- libavcodec/avcodec.h |4 libavcodec/utils.c |2 ++ 2 files changed, 6 insertions(+) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 3813a0a..1db2e0f 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -4050,6 +4050,10 @@ typedef struct AVCodecParameters { * Audio only. Number of samples to skip after a discontinuity. */ int seek_preroll; + +/** Properties, like FF_CODEC_PROPERTY_LOSSLESS. + */ +int properties; } AVCodecParameters; /** diff --git a/libavcodec/utils.c b/libavcodec/utils.c index e6609ef..8638bc2 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -4076,6 +4076,7 @@ int avcodec_parameters_from_context(AVCodecParameters *par, par->bits_per_raw_sample = codec->bits_per_raw_sample; par->profile = codec->profile; par->level = codec->level; +par->properties= codec->properties; switch (par->codec_type) { case AVMEDIA_TYPE_VIDEO: @@ -4130,6 +4131,7 @@ int avcodec_parameters_to_context(AVCodecContext *codec, codec->bits_per_raw_sample = par->bits_per_raw_sample; codec->profile = par->profile; codec->level = par->level; +codec->properties= par->properties; switch (par->codec_type) { case AVMEDIA_TYPE_VIDEO: -- 1.7.9.5 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel