Re: [FFmpeg-devel] avformat/utils : estimate_timings_from_pts - increase retrys

2018-02-06 Thread Michael Niedermayer
On Tue, Feb 06, 2018 at 08:58:01AM +, Gaullier Nicolas wrote:
> >> The number of extra retries to get more than a single duration is 
> >> currently limited to 1 (see commit 77a0df4b5).
> >> This patch raises this number of retries to 4 (amongst the overall 6 max 
> >> retries).
> >> In my experience, the need for 2 extra retries is something commonplace.
> >> 3 extra retries is not far away and we have an exemple on ffmpeg.org :
> >> http://samples.ffmpeg.org/archive/extension/ts/mpegts+mpeg2video+ac3++
> >> mpegts_multiple_ts_packets_pmt_pid_0x50.ts
> 
> >This would make the code read much more of the file if it cannotz figure out 
> >the duration of every stream.
> >In which use case are the individual stream durations needed ?
> >
> >btw, while 4 retries might sound low, each reads twice as much data than the 
> >previous IIRC
> 
> The use case is probing, and especially quickly determining the exact number 
> of video frames (guessing ptses are correct), but indeed, it is useless for a 
> regular ffmpeg transcoding command.

> Maybe a better option would be to change the "#define DURATION_MAX_READ_SIZE" 
> by an overridable command line option ?
> Then, when using for example ffprobe, I could raise the max readsize to 4Mo 
> to cover my worst case scenario without affecting the default behaviour.

yes, something like that would make sense i guess, question though is also how
bad the extra read is in practice. Maybe it affects few files or it can be
made to not read alot in almost all files
that would require some testing

thx

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

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus


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


[FFmpeg-devel] avformat/utils : estimate_timings_from_pts - increase retrys

2018-02-06 Thread Gaullier Nicolas
>> The number of extra retries to get more than a single duration is currently 
>> limited to 1 (see commit 77a0df4b5).
>> This patch raises this number of retries to 4 (amongst the overall 6 max 
>> retries).
>> In my experience, the need for 2 extra retries is something commonplace.
>> 3 extra retries is not far away and we have an exemple on ffmpeg.org :
>> http://samples.ffmpeg.org/archive/extension/ts/mpegts+mpeg2video+ac3++
>> mpegts_multiple_ts_packets_pmt_pid_0x50.ts

>This would make the code read much more of the file if it cannotz figure out 
>the duration of every stream.
>In which use case are the individual stream durations needed ?
>
>btw, while 4 retries might sound low, each reads twice as much data than the 
>previous IIRC

The use case is probing, and especially quickly determining the exact number of 
video frames (guessing ptses are correct), but indeed, it is useless for a 
regular ffmpeg transcoding command.
Maybe a better option would be to change the "#define DURATION_MAX_READ_SIZE" 
by an overridable command line option ?
Then, when using for example ffprobe, I could raise the max readsize to 4Mo to 
cover my worst case scenario without affecting the default behaviour.

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


Re: [FFmpeg-devel] avformat/utils : estimate_timings_from_pts - increase retrys

2018-02-05 Thread Michael Niedermayer
On Mon, Feb 05, 2018 at 05:52:25PM +, Gaullier Nicolas wrote:
> The number of extra retries to get more than a single duration is currently 
> limited to 1 (see commit 77a0df4b5).
> This patch raises this number of retries to 4 (amongst the overall 6 max 
> retries).
> In my experience, the need for 2 extra retries is something commonplace.
> 3 extra retries is not far away and we have an exemple on ffmpeg.org :
> http://samples.ffmpeg.org/archive/extension/ts/mpegts+mpeg2video+ac3++mpegts_multiple_ts_packets_pmt_pid_0x50.ts
> 
> I have encountered at least one time a file (SPTS) that requires 4 extra 
> retries, this is why I propose to set this value.
> 
> Thank you for your review
> Nicolas Gaullier

>  utils.c |6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> f28d63e7efcfc9dae66a90d2a3bd32b65f983bd4  
> 0001-avformat-utils-estimate_timings_from_pts-increase-re.patch
> From a11e24cc03932264eeb3ea09007cc253e0aa9968 Mon Sep 17 00:00:00 2001
> From: Nicolas Gaullier 
> Date: Mon, 5 Feb 2018 18:14:27 +0100
> Subject: [PATCH] avformat/utils : estimate_timings_from_pts - increase retrys
>  if missing some a/v durations

This would make the code read much more of the file if it cannotz figure
out the duration of every stream.

In which use case are the individual stream durations needed ?

btw, while 4 retries might sound low, each reads twice as much data
than the previous IIRC

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Take away the freedom of one citizen and you will be jailed, take away
the freedom of all citizens and you will be congratulated by your peers
in Parliament.


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


[FFmpeg-devel] avformat/utils : estimate_timings_from_pts - increase retrys

2018-02-05 Thread Gaullier Nicolas
The number of extra retries to get more than a single duration is currently 
limited to 1 (see commit 77a0df4b5).
This patch raises this number of retries to 4 (amongst the overall 6 max 
retries).
In my experience, the need for 2 extra retries is something commonplace.
3 extra retries is not far away and we have an exemple on ffmpeg.org :
http://samples.ffmpeg.org/archive/extension/ts/mpegts+mpeg2video+ac3++mpegts_multiple_ts_packets_pmt_pid_0x50.ts

I have encountered at least one time a file (SPTS) that requires 4 extra 
retries, this is why I propose to set this value.

Thank you for your review
Nicolas Gaullier


0001-avformat-utils-estimate_timings_from_pts-increase-re.patch
Description: 0001-avformat-utils-estimate_timings_from_pts-increase-re.patch
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel