[FFmpeg-devel] avcodec/dvdec: add frame threads

Submitted by Michael Niedermayer on April 17, 2019, 11:23 p.m.

Details

Message ID 20190417232339.GT3501@michaelspb
State New
Headers show

Commit Message

Michael Niedermayer April 17, 2019, 11:23 p.m.
On Thu, Apr 18, 2019 at 01:19:58AM +0200, Michael Niedermayer wrote:
> On Wed, Apr 17, 2019 at 06:16:39PM +0200, Paul B Mahol wrote:
> > Signed-off-by: Paul B Mahol <onemda@gmail.com>
> > ---
> >  libavcodec/dvdec.c | 19 ++++++++++---------
> >  1 file changed, 10 insertions(+), 9 deletions(-)
> 
> Is this intended to be 100% same output ?
> 
> I have a few cases that produce differences. Dont have a good testcase though
> ./ffmpeg -i ~/tickets/1589/A1590.dv avi-b.avi
> produces different output.
> oddly -f framecrc produces the same output
> not sure this is a problem or not the input file may have issues

heres another testcase:
./ffmpeg -i ~/tickets/2390/dv_cut.dv aviavi2.avi

-rw-r----- 1 michael michael 112414 Apr 18 01:18 aviavi2.avi
-rw-r----- 1 michael michael 112446 Apr 18 01:18 aviavi.avi


[...]

Comments

Paul B Mahol April 18, 2019, 8:30 a.m.
On 4/18/19, Michael Niedermayer <michael@niedermayer.cc> wrote:
> On Thu, Apr 18, 2019 at 01:19:58AM +0200, Michael Niedermayer wrote:
>> On Wed, Apr 17, 2019 at 06:16:39PM +0200, Paul B Mahol wrote:
>> > Signed-off-by: Paul B Mahol <onemda@gmail.com>
>> > ---
>> >  libavcodec/dvdec.c | 19 ++++++++++---------
>> >  1 file changed, 10 insertions(+), 9 deletions(-)
>>
>> Is this intended to be 100% same output ?
>>
>> I have a few cases that produce differences. Dont have a good testcase
>> though
>> ./ffmpeg -i ~/tickets/1589/A1590.dv avi-b.avi
>> produces different output.
>> oddly -f framecrc produces the same output
>> not sure this is a problem or not the input file may have issues
>
> heres another testcase:
> ./ffmpeg -i ~/tickets/2390/dv_cut.dv aviavi2.avi
>
> -rw-r----- 1 michael michael 112414 Apr 18 01:18 aviavi2.avi
> -rw-r----- 1 michael michael 112446 Apr 18 01:18 aviavi.avi
> --- strings1	2019-04-18 01:19:42.472574387 +0200
> +++ strings2	2019-04-18 01:19:37.764574245 +0200
> @@ -1,4 +1,4 @@
> -RIFF6
> +RIFF
>  AVI LIST
>  hdrlavih8
>  LIST
> @@ -8,7 +8,7 @@
>  FMP4
>  JUNK
>  00dc
> -vprpd
> +vprpD
>  LIST
>  strlstrh8
>  auds

This is because audio is muxed differently.
This bug have nothing to do with this patch.
Michael Niedermayer April 18, 2019, 9:40 a.m.
On Thu, Apr 18, 2019 at 10:30:49AM +0200, Paul B Mahol wrote:
> On 4/18/19, Michael Niedermayer <michael@niedermayer.cc> wrote:
> > On Thu, Apr 18, 2019 at 01:19:58AM +0200, Michael Niedermayer wrote:
> >> On Wed, Apr 17, 2019 at 06:16:39PM +0200, Paul B Mahol wrote:
> >> > Signed-off-by: Paul B Mahol <onemda@gmail.com>
> >> > ---
> >> >  libavcodec/dvdec.c | 19 ++++++++++---------
> >> >  1 file changed, 10 insertions(+), 9 deletions(-)
> >>
> >> Is this intended to be 100% same output ?
> >>
> >> I have a few cases that produce differences. Dont have a good testcase
> >> though
> >> ./ffmpeg -i ~/tickets/1589/A1590.dv avi-b.avi
> >> produces different output.
> >> oddly -f framecrc produces the same output
> >> not sure this is a problem or not the input file may have issues
> >
> > heres another testcase:
> > ./ffmpeg -i ~/tickets/2390/dv_cut.dv aviavi2.avi
> >
> > -rw-r----- 1 michael michael 112414 Apr 18 01:18 aviavi2.avi
> > -rw-r----- 1 michael michael 112446 Apr 18 01:18 aviavi.avi
> > --- strings1	2019-04-18 01:19:42.472574387 +0200
> > +++ strings2	2019-04-18 01:19:37.764574245 +0200
> > @@ -1,4 +1,4 @@
> > -RIFF6
> > +RIFF
> >  AVI LIST
> >  hdrlavih8
> >  LIST
> > @@ -8,7 +8,7 @@
> >  FMP4
> >  JUNK
> >  00dc
> > -vprpd
> > +vprpD
> >  LIST
> >  strlstrh8
> >  auds
> 
> This is because audio is muxed differently.
> This bug have nothing to do with this patch.

iam not sure thats the case. Looking at this again now in the morning
VPRP is different and the muxer receives a different par->field_order
(0 vs. 5). I dont think audio should afect the video field_order

[...]
Paul B Mahol April 18, 2019, 10:10 a.m.
On 4/18/19, Michael Niedermayer <michael@niedermayer.cc> wrote:
> On Thu, Apr 18, 2019 at 10:30:49AM +0200, Paul B Mahol wrote:
>> On 4/18/19, Michael Niedermayer <michael@niedermayer.cc> wrote:
>> > On Thu, Apr 18, 2019 at 01:19:58AM +0200, Michael Niedermayer wrote:
>> >> On Wed, Apr 17, 2019 at 06:16:39PM +0200, Paul B Mahol wrote:
>> >> > Signed-off-by: Paul B Mahol <onemda@gmail.com>
>> >> > ---
>> >> >  libavcodec/dvdec.c | 19 ++++++++++---------
>> >> >  1 file changed, 10 insertions(+), 9 deletions(-)
>> >>
>> >> Is this intended to be 100% same output ?
>> >>
>> >> I have a few cases that produce differences. Dont have a good testcase
>> >> though
>> >> ./ffmpeg -i ~/tickets/1589/A1590.dv avi-b.avi
>> >> produces different output.
>> >> oddly -f framecrc produces the same output
>> >> not sure this is a problem or not the input file may have issues
>> >
>> > heres another testcase:
>> > ./ffmpeg -i ~/tickets/2390/dv_cut.dv aviavi2.avi
>> >
>> > -rw-r----- 1 michael michael 112414 Apr 18 01:18 aviavi2.avi
>> > -rw-r----- 1 michael michael 112446 Apr 18 01:18 aviavi.avi
>> > --- strings1	2019-04-18 01:19:42.472574387 +0200
>> > +++ strings2	2019-04-18 01:19:37.764574245 +0200
>> > @@ -1,4 +1,4 @@
>> > -RIFF6
>> > +RIFF
>> >  AVI LIST
>> >  hdrlavih8
>> >  LIST
>> > @@ -8,7 +8,7 @@
>> >  FMP4
>> >  JUNK
>> >  00dc
>> > -vprpd
>> > +vprpD
>> >  LIST
>> >  strlstrh8
>> >  auds
>>
>> This is because audio is muxed differently.
>> This bug have nothing to do with this patch.
>
> iam not sure thats the case. Looking at this again now in the morning
> VPRP is different and the muxer receives a different par->field_order
> (0 vs. 5). I dont think audio should afect the video field_order

Can't reproduce.

>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Democracy is the form of government in which you can choose your dictator
>
Tobias Rapp April 18, 2019, 10:13 a.m.
On 18.04.2019 11:40, Michael Niedermayer wrote:
> On Thu, Apr 18, 2019 at 10:30:49AM +0200, Paul B Mahol wrote:
>> On 4/18/19, Michael Niedermayer <michael@niedermayer.cc> wrote:
>>> On Thu, Apr 18, 2019 at 01:19:58AM +0200, Michael Niedermayer wrote:
>>>> On Wed, Apr 17, 2019 at 06:16:39PM +0200, Paul B Mahol wrote:
>>>>> Signed-off-by: Paul B Mahol <onemda@gmail.com>
>>>>> ---
>>>>>   libavcodec/dvdec.c | 19 ++++++++++---------
>>>>>   1 file changed, 10 insertions(+), 9 deletions(-)
>>>>
>>>> Is this intended to be 100% same output ?
>>>>
>>>> I have a few cases that produce differences. Dont have a good testcase
>>>> though
>>>> ./ffmpeg -i ~/tickets/1589/A1590.dv avi-b.avi
>>>> produces different output.
>>>> oddly -f framecrc produces the same output
>>>> not sure this is a problem or not the input file may have issues
>>>
>>> heres another testcase:
>>> ./ffmpeg -i ~/tickets/2390/dv_cut.dv aviavi2.avi
>>>
>>> [...]
>>
>> This is because audio is muxed differently.
>> This bug have nothing to do with this patch.
> 
> iam not sure thats the case. Looking at this again now in the morning
> VPRP is different and the muxer receives a different par->field_order
> (0 vs. 5). I dont think audio should afect the video field_order

That might be caused by frame-threading in general and not explicitly by 
the dv decoder. Have experienced field_order information not being 
reliably forwarded to the muxer in ffmpeg before. Seems sometimes the 
encoder settings are updated too late to be picked up by the muxer when 
writing header information.

Regards,
Tobias
Paul B Mahol April 19, 2019, 6:03 p.m.
On 4/18/19, Tobias Rapp <t.rapp@noa-archive.com> wrote:
> On 18.04.2019 11:40, Michael Niedermayer wrote:
>> On Thu, Apr 18, 2019 at 10:30:49AM +0200, Paul B Mahol wrote:
>>> On 4/18/19, Michael Niedermayer <michael@niedermayer.cc> wrote:
>>>> On Thu, Apr 18, 2019 at 01:19:58AM +0200, Michael Niedermayer wrote:
>>>>> On Wed, Apr 17, 2019 at 06:16:39PM +0200, Paul B Mahol wrote:
>>>>>> Signed-off-by: Paul B Mahol <onemda@gmail.com>
>>>>>> ---
>>>>>>   libavcodec/dvdec.c | 19 ++++++++++---------
>>>>>>   1 file changed, 10 insertions(+), 9 deletions(-)
>>>>>
>>>>> Is this intended to be 100% same output ?
>>>>>
>>>>> I have a few cases that produce differences. Dont have a good testcase
>>>>> though
>>>>> ./ffmpeg -i ~/tickets/1589/A1590.dv avi-b.avi
>>>>> produces different output.
>>>>> oddly -f framecrc produces the same output
>>>>> not sure this is a problem or not the input file may have issues
>>>>
>>>> heres another testcase:
>>>> ./ffmpeg -i ~/tickets/2390/dv_cut.dv aviavi2.avi
>>>>
>>>> [...]
>>>
>>> This is because audio is muxed differently.
>>> This bug have nothing to do with this patch.
>>
>> iam not sure thats the case. Looking at this again now in the morning
>> VPRP is different and the muxer receives a different par->field_order
>> (0 vs. 5). I dont think audio should afect the video field_order
>
> That might be caused by frame-threading in general and not explicitly by
> the dv decoder. Have experienced field_order information not being
> reliably forwarded to the muxer in ffmpeg before. Seems sometimes the
> encoder settings are updated too late to be picked up by the muxer when
> writing header information.

Yes, I agree, will push patch soon.

Patch hide | download patch | download mbox

--- strings1	2019-04-18 01:19:42.472574387 +0200
+++ strings2	2019-04-18 01:19:37.764574245 +0200
@@ -1,4 +1,4 @@ 
-RIFF6
+RIFF
 AVI LIST
 hdrlavih8
 LIST
@@ -8,7 +8,7 @@ 
 FMP4
 JUNK
 00dc
-vprpd
+vprpD
 LIST
 strlstrh8
 auds