Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-12-20 Thread Michael Niedermayer
On Mon, Dec 18, 2017 at 03:31:16PM -0800, Sasi Inguva wrote: > Signed-off-by: Sasi Inguva > --- > libavformat/mov.c| 56 > > tests/fate/mov.mak | 7 + > tests/ref/fate/mov-guess-delay-1 | 3 +++ >

[FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-12-18 Thread Sasi Inguva
Signed-off-by: Sasi Inguva --- libavformat/mov.c| 56 tests/fate/mov.mak | 7 + tests/ref/fate/mov-guess-delay-1 | 3 +++ tests/ref/fate/mov-guess-delay-2 | 3 +++ tests/ref/fate/mov-guess-delay-3 |

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-12-18 Thread Sasi Inguva
Sorry for getting back so late as I was on vacation. Submitting the patch again. This time I compute the delay exactly using a 17 element circular buffer to sort the timestamps. PTAL. On Wed, Nov 22, 2017 at 4:43 AM, Michael Niedermayer wrote: > On Wed, Nov 22, 2017 at

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-22 Thread Michael Niedermayer
On Wed, Nov 22, 2017 at 01:21:45PM +0530, Sasi Inguva wrote: > I was just shooting for a heuristic which works for most of the cases. I do not think a heuristic is a good idea. Its not very hard to compute this exactly. You just reorder using a 16 entry buffer and keep track of what the largest

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-22 Thread Sasi Inguva
I was just shooting for a heuristic which works for most of the cases. Most GOP structures are like this in decoding order PTS: Pmin , Pmax , (Pmin + k) , (Pmin + k -1) ... (Pmin + 1) , (Pmin + 2k) , (Pmin + 2k -1) ... (Pmin + k + 1) (Pmax + 1) PICT_TYPE: I0 I1

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-21 Thread Michael Niedermayer
On Mon, Nov 20, 2017 at 08:27:05PM -0800, Sasi Inguva wrote: > Signed-off-by: Sasi Inguva > --- > libavformat/mov.c| 50 > > tests/fate/mov.mak | 7 ++ > tests/ref/fate/mov-guess-delay-1 | 3 +++ >

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-21 Thread Michael Niedermayer
On Tue, Nov 21, 2017 at 09:59:08AM +0530, Sasi Inguva wrote: > Reattaching Fate sample. uploaded [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB It is dangerous to be right in matters on which the established authorities are wrong. -- Voltaire signature.asc

[FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-20 Thread Sasi Inguva
Signed-off-by: Sasi Inguva --- libavformat/mov.c| 50 tests/fate/mov.mak | 7 ++ tests/ref/fate/mov-guess-delay-1 | 3 +++ tests/ref/fate/mov-guess-delay-2 | 3 +++ tests/ref/fate/mov-guess-delay-3 |

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-20 Thread Sasi Inguva
Reattaching Fate sample. On Tue, Nov 21, 2017 at 9:57 AM, Sasi Inguva wrote: > Signed-off-by: Sasi Inguva > --- > libavformat/mov.c| 50 ++ > ++ > tests/fate/mov.mak | 7 ++ >

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-20 Thread Sasi Inguva
Ok. Just restricting this to H264 . On Tue, Nov 21, 2017 at 3:56 AM, Hendrik Leppkes wrote: > On Mon, Nov 20, 2017 at 11:06 PM, Michael Niedermayer > wrote: > > On Mon, Nov 20, 2017 at 09:58:05PM +0530, Sasi Inguva wrote: > >> On Sun, Nov 19, 2017

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-20 Thread Hendrik Leppkes
On Mon, Nov 20, 2017 at 11:06 PM, Michael Niedermayer wrote: > On Mon, Nov 20, 2017 at 09:58:05PM +0530, Sasi Inguva wrote: >> On Sun, Nov 19, 2017 at 1:17 AM, Michael Niedermayer > > wrote: >> >> > On Sat, Nov 18, 2017 at 11:12:17AM -0800, Sasi

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-20 Thread Michael Niedermayer
On Mon, Nov 20, 2017 at 09:58:05PM +0530, Sasi Inguva wrote: > On Sun, Nov 19, 2017 at 1:17 AM, Michael Niedermayer > wrote: > > > On Sat, Nov 18, 2017 at 11:12:17AM -0800, Sasi Inguva wrote: > > > Signed-off-by: Sasi Inguva > > > --- > > >

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-20 Thread Sasi Inguva
Attaching the fate sample On Mon, Nov 20, 2017 at 8:28 AM, Sasi Inguva wrote: > Signed-off-by: Sasi Inguva > --- > libavformat/mov.c| 55 ++ > ++ > tests/fate/mov.mak | 7 + >

[FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-20 Thread Sasi Inguva
Signed-off-by: Sasi Inguva --- libavformat/mov.c| 55 tests/fate/mov.mak | 7 + tests/ref/fate/mov-guess-delay-1 | 3 +++ tests/ref/fate/mov-guess-delay-2 | 3 +++ tests/ref/fate/mov-guess-delay-3 |

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-20 Thread Sasi Inguva
On Sun, Nov 19, 2017 at 1:17 AM, Michael Niedermayer wrote: > On Sat, Nov 18, 2017 at 11:12:17AM -0800, Sasi Inguva wrote: > > Signed-off-by: Sasi Inguva > > --- > > libavformat/mov.c| 54 ++ > ++ > >

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-18 Thread Michael Niedermayer
On Sat, Nov 18, 2017 at 11:12:17AM -0800, Sasi Inguva wrote: > Signed-off-by: Sasi Inguva > --- > libavformat/mov.c| 54 > > tests/fate/mov.mak | 5 > tests/ref/fate/mov-guess-delay-1 | 3 +++ >

[FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-18 Thread Sasi Inguva
Signed-off-by: Sasi Inguva --- libavformat/mov.c| 54 tests/fate/mov.mak | 5 tests/ref/fate/mov-guess-delay-1 | 3 +++ tests/ref/fate/mov-guess-delay-2 | 3 +++ 4 files changed, 65 insertions(+)

[FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-18 Thread Sasi Inguva
Done. is there a better way to identify codecs that might need Signed-off-by: Sasi Inguva --- libavformat/mov.c| 52 tests/fate/mov.mak | 5 tests/ref/fate/mov-guess-delay-1 | 3 +++

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-18 Thread Carl Eugen Hoyos
2017-11-18 7:12 GMT+01:00 Sasi Inguva : > +if (st->codecpar->video_delay <= 0 && msc->ctts_data && > +(st->codecpar->codec_id == AV_CODEC_ID_MPEG2VIDEO || > + st->codecpar->codec_id == AV_CODEC_ID_H263 || > + st->codecpar->codec_id ==

[FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-17 Thread Sasi Inguva
Signed-off-by: Sasi Inguva --- libavformat/mov.c| 52 tests/fate/mov.mak | 5 tests/ref/fate/mov-guess-delay-1 | 3 +++ tests/ref/fate/mov-guess-delay-2 | 3 +++ 4 files changed, 63 insertions(+)

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-17 Thread Sasi Inguva
restricted the patch to MPEG based codecs. Also, setting the delay only if it's not set already and capping the max. value to 16. On Wed, Nov 15, 2017 at 5:55 AM, Michael Niedermayer wrote: > On Tue, Nov 14, 2017 at 03:36:49PM -0800, Thierry Foucu wrote: > > On Tue, Nov

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-14 Thread Michael Niedermayer
On Tue, Nov 14, 2017 at 03:36:49PM -0800, Thierry Foucu wrote: > On Tue, Nov 14, 2017 at 3:23 PM, Derek Buitenhuis < > derek.buitenh...@gmail.com> wrote: > > > On 11/14/2017 10:11 PM, Sasi Inguva wrote: > > > I don't know if the patch can be made more generic to work for all > > > demuxers,

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-14 Thread Carl Eugen Hoyos
2017-11-15 0:36 GMT+01:00 Thierry Foucu : > On Tue, Nov 14, 2017 at 3:23 PM, Derek Buitenhuis < > derek.buitenh...@gmail.com> wrote: > >> On 11/14/2017 10:11 PM, Sasi Inguva wrote: >> > I don't know if the patch can be made more generic to work for all >> > demuxers, because this

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-14 Thread Derek Buitenhuis
On 11/14/2017 11:36 PM, Thierry Foucu wrote: > One option i asked on IRC was to use the spec for max DPB when the bitstream > restriction flag was not set. > But people were worry about low latency usage. > Normally, if the bitstream restriction flag is not set, the DPB should be > set based on

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-14 Thread Thierry Foucu
On Tue, Nov 14, 2017 at 3:23 PM, Derek Buitenhuis < derek.buitenh...@gmail.com> wrote: > On 11/14/2017 10:11 PM, Sasi Inguva wrote: > > I don't know if the patch can be made more generic to work for all > > demuxers, because this patch requires that PTS of all packets be > available > > in the

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-14 Thread Derek Buitenhuis
On 11/14/2017 10:11 PM, Sasi Inguva wrote: > I don't know if the patch can be made more generic to work for all > demuxers, because this patch requires that PTS of all packets be available > in the header. The other route is to make it very specific to codecs with > B-frames. All PTS may not be

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-14 Thread Sasi Inguva
I don't know if the patch can be made more generic to work for all demuxers, because this patch requires that PTS of all packets be available in the header. The other route is to make it very specific to codecs with B-frames. On Tue, Nov 14, 2017 at 12:40 PM, Derek Buitenhuis <

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-14 Thread Derek Buitenhuis
On 11/14/2017 8:28 PM, Sasi Inguva wrote: > For H264 files with no bitstream restriction flag, we aren't able to guess > the delay correctly. Especially if it's MOV container, because for MOV > container we just probe the 1st frame and stop in avformat_find_streaminfo . You do not appear to be

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-14 Thread Hendrik Leppkes
On Tue, Nov 14, 2017 at 9:28 PM, Sasi Inguva wrote: > For H264 files with no bitstream restriction flag, we aren't able to guess > the delay correctly. Especially if it's MOV container, because for MOV > container we just probe the 1st frame and stop in

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-14 Thread Michael Niedermayer
On Tue, Nov 14, 2017 at 09:39:33AM -0800, Sasi Inguva wrote: > Sorry forgot to attach the fate samples. Pls find them attached. uploaded thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Its not that you shouldnt use gotos but rather that you should write

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-14 Thread Sasi Inguva
For H264 files with no bitstream restriction flag, we aren't able to guess the delay correctly. Especially if it's MOV container, because for MOV container we just probe the 1st frame and stop in avformat_find_streaminfo . When we are decoding , we increase the has_b_frames value from zero to 1

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-14 Thread Derek Buitenhuis
On 11/14/2017 2:15 AM, Sasi Inguva wrote: > Signed-off-by: Sasi Inguva > --- > libavformat/mov.c| 48 > > tests/fate/mov.mak | 5 + > tests/ref/fate/mov-guess-delay-1 | 3 +++ >

Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-14 Thread Michael Niedermayer
On Mon, Nov 13, 2017 at 06:15:05PM -0800, Sasi Inguva wrote: [...] > +fate-mov-guess-delay-1: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries > stream=has_b_frames -select_streams v > $(TARGET_SAMPLES)/h264/h264_3bf_nopyramid_nobsrestriction.mp4 > +fate-mov-guess-delay-2: CMD = run

[FFmpeg-devel] [PATCH] lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.

2017-11-13 Thread Sasi Inguva
Signed-off-by: Sasi Inguva --- libavformat/mov.c| 48 tests/fate/mov.mak | 5 + tests/ref/fate/mov-guess-delay-1 | 3 +++ tests/ref/fate/mov-guess-delay-2 | 3 +++ 4 files changed, 59 insertions(+)