Re: [FFmpeg-devel] [PATCH 2/2] lavf/utils: add flag to discard timestamps on corrupted frames

2017-12-07 Thread Rodger Combs


> On Dec 7, 2017, at 16:53, Hendrik Leppkes  wrote:
> 
> On Thu, Dec 7, 2017 at 9:46 PM, Michael Niedermayer
> mailto:mich...@niedermayer.cc>> wrote:
>> On Thu, Dec 07, 2017 at 03:37:38AM -0600, Rodger Combs wrote:
>>> ---
>>> libavformat/avformat.h  |  1 +
>>> libavformat/internal.h  |  5 +
>>> libavformat/options_table.h |  1 +
>>> libavformat/utils.c | 12 
>>> 4 files changed, 19 insertions(+)
>>> 
>>> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
>>> index 4f2798a871..e2d88280a8 100644
>>> --- a/libavformat/avformat.h
>>> +++ b/libavformat/avformat.h
>>> @@ -1450,6 +1450,7 @@ typedef struct AVFormatContext {
>>> #define AVFMT_FLAG_FAST_SEEK   0x8 ///< Enable fast, but inaccurate 
>>> seeks for some formats
>>> #define AVFMT_FLAG_SHORTEST   0x10 ///< Stop muxing when the shortest 
>>> stream stops.
>>> #define AVFMT_FLAG_AUTO_BSF   0x20 ///< Add bitstream filters as 
>>> requested by the muxer
>>> +#define AVFMT_FLAG_DISCARD_CORRUPT_TS 0x40 ///< Discard timestamps of 
>>> frames marked corrupt (replacing with wallclock offset from last 
>>> non-corrupt frame)
>> 
>> Using wallclock to fill in timestamps feels wrong
>> if you discard a timestamp it should be set to AV_NOPTS_VALUE or
>> recomputed based on information from the specification where this is
>> possible, fps when constant or other hard information.
>> 
> 
> I agree, discard should be just that, set it to invalid. Wallclock is
> meaningless on anything but a live stream.

My intended use-case is live streams, where wallclock can be more useful than 
deriving from fps if e.g. entire packets are dropped. I could have one flag to 
unset timestamps on corrupt packets, and another to fill unset DTS from 
wallclock?

> 
> - 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 2/2] lavf/utils: add flag to discard timestamps on corrupted frames

2017-12-07 Thread Hendrik Leppkes
On Thu, Dec 7, 2017 at 9:46 PM, Michael Niedermayer
 wrote:
> On Thu, Dec 07, 2017 at 03:37:38AM -0600, Rodger Combs wrote:
>> ---
>>  libavformat/avformat.h  |  1 +
>>  libavformat/internal.h  |  5 +
>>  libavformat/options_table.h |  1 +
>>  libavformat/utils.c | 12 
>>  4 files changed, 19 insertions(+)
>>
>> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
>> index 4f2798a871..e2d88280a8 100644
>> --- a/libavformat/avformat.h
>> +++ b/libavformat/avformat.h
>> @@ -1450,6 +1450,7 @@ typedef struct AVFormatContext {
>>  #define AVFMT_FLAG_FAST_SEEK   0x8 ///< Enable fast, but inaccurate 
>> seeks for some formats
>>  #define AVFMT_FLAG_SHORTEST   0x10 ///< Stop muxing when the shortest 
>> stream stops.
>>  #define AVFMT_FLAG_AUTO_BSF   0x20 ///< Add bitstream filters as 
>> requested by the muxer
>> +#define AVFMT_FLAG_DISCARD_CORRUPT_TS 0x40 ///< Discard timestamps of 
>> frames marked corrupt (replacing with wallclock offset from last non-corrupt 
>> frame)
>
> Using wallclock to fill in timestamps feels wrong
> if you discard a timestamp it should be set to AV_NOPTS_VALUE or
> recomputed based on information from the specification where this is
> possible, fps when constant or other hard information.
>

I agree, discard should be just that, set it to invalid. Wallclock is
meaningless on anything but a live stream.

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


Re: [FFmpeg-devel] [PATCH 2/2] lavf/utils: add flag to discard timestamps on corrupted frames

2017-12-07 Thread Michael Niedermayer
On Thu, Dec 07, 2017 at 03:37:38AM -0600, Rodger Combs wrote:
> ---
>  libavformat/avformat.h  |  1 +
>  libavformat/internal.h  |  5 +
>  libavformat/options_table.h |  1 +
>  libavformat/utils.c | 12 
>  4 files changed, 19 insertions(+)
> 
> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> index 4f2798a871..e2d88280a8 100644
> --- a/libavformat/avformat.h
> +++ b/libavformat/avformat.h
> @@ -1450,6 +1450,7 @@ typedef struct AVFormatContext {
>  #define AVFMT_FLAG_FAST_SEEK   0x8 ///< Enable fast, but inaccurate 
> seeks for some formats
>  #define AVFMT_FLAG_SHORTEST   0x10 ///< Stop muxing when the shortest 
> stream stops.
>  #define AVFMT_FLAG_AUTO_BSF   0x20 ///< Add bitstream filters as 
> requested by the muxer
> +#define AVFMT_FLAG_DISCARD_CORRUPT_TS 0x40 ///< Discard timestamps of 
> frames marked corrupt (replacing with wallclock offset from last non-corrupt 
> frame)

Using wallclock to fill in timestamps feels wrong
if you discard a timestamp it should be set to AV_NOPTS_VALUE or
recomputed based on information from the specification where this is
possible, fps when constant or other hard information.

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

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway


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