Re: [FFmpeg-devel] [PATCH] mov: Evaluate the movie display matrix

2016-10-08 Thread Michael Niedermayer
On Fri, Oct 07, 2016 at 10:38:22PM -0400, Vittorio Giovara wrote:
> On Fri, Oct 7, 2016 at 8:38 PM, Michael Niedermayer
>  wrote:
> > On Fri, Oct 07, 2016 at 03:31:46PM -0400, Vittorio Giovara wrote:
> >> This matrix needs to be applied after all others have (currently only
> >> display matrix from trak), but cannot be handled in movie box, since
> >> streams are not allocated yet.
> >>
> >> So store it in main context and if not identity, apply it when appropriate,
> >> handling the case when trak display matrix is identity and when it is not.
> >>
> >> Signed-off-by: Vittorio Giovara 
> >> ---
> >
> >> +} else { // otherwise multiply the two and store the result
> >> +int64_t val = 0;
> >> +for (i = 0; i < 3; i++) {
> >> +for (j = 0; j < 3; j++) {
> >> +int sh = j == 2 ? 30 : 16;
> >> +for (e = 0; e < 3; e++) {
> >> +val += CONV_FP2INT(display_matrix[i][e], sh) *
> >> +   CONV_FP2INT(c->movie_display_matrix[e][j], 
> >> sh);
> >
> > This does not work (you are dividing the 32bit numbers down to 2 bit)
> 
> I don't understand this comment, are you referring to the fact that
> the first two columns of the display matrix are 16.16, while the third
> column is 2:30?

you have 32bit integers and sh can be 30, in that case you throw away
30 of 32 bits before doing anything with the number


> 
> > also its not tested by the fate testcase
> > i can just replace it by 0 and fate-mov-movie-display-matrix still
> > passes
> 
> Yes, the sample I shared only has the movie display matrix, not
> trak+movie. I can create another sample if you insist, but a fate test
> would test little more than the matrix multiplication loops.

yes


> 
> > the macros also lack some () protection giving probably unintended
> > results
> 
> Can you tell me how many more () would they need?

#define CONV_FP2INT(x, sh) ((int64_t) (x)) / (1 << sh)

is missing at least 2 pairs

#define CONV_FP2INT(x, sh) (((int64_t) (x)) / (1 << (sh)))

also the rounding is not optimal it should likely be rounding to
nearest
the division can be replaced by a shift while correcting the rounding


> 
> From the subsequent email
> 
> > to explain a bit more how to do it with int64 instead of double floats
> > int32 can be multiplied together to form int64 with a new fixed point
> > without rounding or shifts
> > then added up and then at the end shifted down with rounding to get
> > back to the fixed point needed for the final destination
> 
> The problem is that the display matrix fields have different mantissa
> length, the first two columns are 16.16, the last one is 2:30. I think
> that method would work if all elements were the same length no?

iam not sure the original double code is correct, but it used the same
shift for each output, just changing between outputs.

if that was correct it should work fine, if it was not correct then
some extra shift is needed after the multiplication and before the
addition to get things to match


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

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf


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


Re: [FFmpeg-devel] [PATCH] mov: Evaluate the movie display matrix

2016-10-07 Thread Vittorio Giovara
On Fri, Oct 7, 2016 at 8:38 PM, Michael Niedermayer
 wrote:
> On Fri, Oct 07, 2016 at 03:31:46PM -0400, Vittorio Giovara wrote:
>> This matrix needs to be applied after all others have (currently only
>> display matrix from trak), but cannot be handled in movie box, since
>> streams are not allocated yet.
>>
>> So store it in main context and if not identity, apply it when appropriate,
>> handling the case when trak display matrix is identity and when it is not.
>>
>> Signed-off-by: Vittorio Giovara 
>> ---
>
>> +} else { // otherwise multiply the two and store the result
>> +int64_t val = 0;
>> +for (i = 0; i < 3; i++) {
>> +for (j = 0; j < 3; j++) {
>> +int sh = j == 2 ? 30 : 16;
>> +for (e = 0; e < 3; e++) {
>> +val += CONV_FP2INT(display_matrix[i][e], sh) *
>> +   CONV_FP2INT(c->movie_display_matrix[e][j], 
>> sh);
>
> This does not work (you are dividing the 32bit numbers down to 2 bit)

I don't understand this comment, are you referring to the fact that
the first two columns of the display matrix are 16.16, while the third
column is 2:30?

> also its not tested by the fate testcase
> i can just replace it by 0 and fate-mov-movie-display-matrix still
> passes

Yes, the sample I shared only has the movie display matrix, not
trak+movie. I can create another sample if you insist, but a fate test
would test little more than the matrix multiplication loops.

> the macros also lack some () protection giving probably unintended
> results

Can you tell me how many more () would they need?

From the subsequent email

> to explain a bit more how to do it with int64 instead of double floats
> int32 can be multiplied together to form int64 with a new fixed point
> without rounding or shifts
> then added up and then at the end shifted down with rounding to get
> back to the fixed point needed for the final destination

The problem is that the display matrix fields have different mantissa
length, the first two columns are 16.16, the last one is 2:30. I think
that method would work if all elements were the same length no?
-- 
Vittorio
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] mov: Evaluate the movie display matrix

2016-10-07 Thread Michael Niedermayer
On Sat, Oct 08, 2016 at 02:38:27AM +0200, Michael Niedermayer wrote:
> On Fri, Oct 07, 2016 at 03:31:46PM -0400, Vittorio Giovara wrote:
> > This matrix needs to be applied after all others have (currently only
> > display matrix from trak), but cannot be handled in movie box, since
> > streams are not allocated yet.
> > 
> > So store it in main context and if not identity, apply it when appropriate,
> > handling the case when trak display matrix is identity and when it is not.
> > 
> > Signed-off-by: Vittorio Giovara 
> > ---
> > Updated according review.
> > Vittorio
> > 
> >  libavformat/isom.h  |  2 ++
> >  libavformat/mov.c   | 63 
> > +++--
> >  tests/fate/mov.mak  |  6 +++-
> >  tests/ref/fate/mov-movie-display-matrix | 10 ++
> >  4 files changed, 70 insertions(+), 11 deletions(-)
> >  create mode 100644 tests/ref/fate/mov-movie-display-matrix
> > 
> > diff --git a/libavformat/isom.h b/libavformat/isom.h
> > index 2246fed..2aeb8fa 100644
> > --- a/libavformat/isom.h
> > +++ b/libavformat/isom.h
> > @@ -238,6 +238,8 @@ typedef struct MOVContext {
> >  uint8_t *decryption_key;
> >  int decryption_key_len;
> >  int enable_drefs;
> > +
> > +int32_t movie_display_matrix[3][3]; ///< display matrix from mvhd
> >  } MOVContext;
> >  
> >  int ff_mp4_read_descr_len(AVIOContext *pb);
> > diff --git a/libavformat/mov.c b/libavformat/mov.c
> > index a15c8d1..307ce08 100644
> > --- a/libavformat/mov.c
> > +++ b/libavformat/mov.c
> > @@ -1211,6 +1211,7 @@ static int mov_read_mdhd(MOVContext *c, AVIOContext 
> > *pb, MOVAtom atom)
> >  
> >  static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
> >  {
> > +int i;
> >  int64_t creation_time;
> >  int version = avio_r8(pb); /* version */
> >  avio_rb24(pb); /* flags */
> > @@ -1238,7 +1239,12 @@ static int mov_read_mvhd(MOVContext *c, AVIOContext 
> > *pb, MOVAtom atom)
> >  
> >  avio_skip(pb, 10); /* reserved */
> >  
> > -avio_skip(pb, 36); /* display matrix */
> > +/* movie display matrix, store it in main context and use it later on 
> > */
> > +for (i = 0; i < 3; i++) {
> > +c->movie_display_matrix[i][0] = avio_rb32(pb); // 16.16 fixed point
> > +c->movie_display_matrix[i][1] = avio_rb32(pb); // 16.16 fixed point
> > +c->movie_display_matrix[i][2] = avio_rb32(pb); //  2.30 fixed point
> > +}
> >  
> >  avio_rb32(pb); /* preview time */
> >  avio_rb32(pb); /* preview duration */
> > @@ -3798,9 +3804,24 @@ static int mov_read_meta(MOVContext *c, AVIOContext 
> > *pb, MOVAtom atom)
> >  return 0;
> >  }
> >  
> > +// return 0 when matrix is identity, 1 otherwise
> > +#define IS_MATRIX_FULL(matrix)   \
> > +(matrix[0][0] != (1 << 16) ||\
> > + matrix[1][1] != (1 << 16) ||\
> > + matrix[2][2] != (1 << 30) ||\
> > + matrix[0][1] || matrix[0][2] || \
> > + matrix[1][0] || matrix[1][2] || \
> > + matrix[2][0] || matrix[2][1])
> > +
> > +// fixed point to int64_t
> > +#define CONV_FP2INT(x, sh) ((int64_t) (x)) / (1 << sh)
> > +
> > +// int64_t to fixed point
> > +#define CONV_INT2FP(x, sh) (int32_t) ((x) * (1 << sh))
> > +
> >  static int mov_read_tkhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
> >  {
> > -int i;
> > +int i, j, e;
> >  int width;
> >  int height;
> >  int display_matrix[3][3];
> > @@ -3855,13 +3876,7 @@ static int mov_read_tkhd(MOVContext *c, AVIOContext 
> > *pb, MOVAtom atom)
> >  
> >  // save the matrix and add rotate metadata when it is not the default
> >  // identity
> > -if (display_matrix[0][0] != (1 << 16) ||
> > -display_matrix[1][1] != (1 << 16) ||
> > -display_matrix[2][2] != (1 << 30) ||
> > -display_matrix[0][1] || display_matrix[0][2] ||
> > -display_matrix[1][0] || display_matrix[1][2] ||
> > -display_matrix[2][0] || display_matrix[2][1]) {
> > -int i, j;
> > +if (IS_MATRIX_FULL(display_matrix)) {
> >  double rotate;
> >  
> >  av_freep(>display_matrix);
> > @@ -3884,13 +3899,41 @@ static int mov_read_tkhd(MOVContext *c, AVIOContext 
> > *pb, MOVAtom atom)
> >  }
> >  }
> >  
> > +// if movie display matrix is not identity, and if this is a video 
> > track
> > +if (IS_MATRIX_FULL(c->movie_display_matrix) && width && height) {
> > +// if trak display matrix was identity, just copy the movie one
> > +if (!sc->display_matrix) {
> > +sc->display_matrix = av_malloc(sizeof(int32_t) * 9);
> > +if (!sc->display_matrix)
> > +return AVERROR(ENOMEM);
> > +
> > +for (i = 0; i < 3; i++)
> > +for (j = 0; j < 3; j++)
> > +sc->display_matrix[i * 3 + j] = 
> > c->movie_display_matrix[i][j];
> 
> > +} else { // otherwise multiply the two and store the result
> 

Re: [FFmpeg-devel] [PATCH] mov: Evaluate the movie display matrix

2016-10-07 Thread Michael Niedermayer
On Fri, Oct 07, 2016 at 03:31:46PM -0400, Vittorio Giovara wrote:
> This matrix needs to be applied after all others have (currently only
> display matrix from trak), but cannot be handled in movie box, since
> streams are not allocated yet.
> 
> So store it in main context and if not identity, apply it when appropriate,
> handling the case when trak display matrix is identity and when it is not.
> 
> Signed-off-by: Vittorio Giovara 
> ---
> Updated according review.
> Vittorio
> 
>  libavformat/isom.h  |  2 ++
>  libavformat/mov.c   | 63 
> +++--
>  tests/fate/mov.mak  |  6 +++-
>  tests/ref/fate/mov-movie-display-matrix | 10 ++
>  4 files changed, 70 insertions(+), 11 deletions(-)
>  create mode 100644 tests/ref/fate/mov-movie-display-matrix
> 
> diff --git a/libavformat/isom.h b/libavformat/isom.h
> index 2246fed..2aeb8fa 100644
> --- a/libavformat/isom.h
> +++ b/libavformat/isom.h
> @@ -238,6 +238,8 @@ typedef struct MOVContext {
>  uint8_t *decryption_key;
>  int decryption_key_len;
>  int enable_drefs;
> +
> +int32_t movie_display_matrix[3][3]; ///< display matrix from mvhd
>  } MOVContext;
>  
>  int ff_mp4_read_descr_len(AVIOContext *pb);
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index a15c8d1..307ce08 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -1211,6 +1211,7 @@ static int mov_read_mdhd(MOVContext *c, AVIOContext 
> *pb, MOVAtom atom)
>  
>  static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>  {
> +int i;
>  int64_t creation_time;
>  int version = avio_r8(pb); /* version */
>  avio_rb24(pb); /* flags */
> @@ -1238,7 +1239,12 @@ static int mov_read_mvhd(MOVContext *c, AVIOContext 
> *pb, MOVAtom atom)
>  
>  avio_skip(pb, 10); /* reserved */
>  
> -avio_skip(pb, 36); /* display matrix */
> +/* movie display matrix, store it in main context and use it later on */
> +for (i = 0; i < 3; i++) {
> +c->movie_display_matrix[i][0] = avio_rb32(pb); // 16.16 fixed point
> +c->movie_display_matrix[i][1] = avio_rb32(pb); // 16.16 fixed point
> +c->movie_display_matrix[i][2] = avio_rb32(pb); //  2.30 fixed point
> +}
>  
>  avio_rb32(pb); /* preview time */
>  avio_rb32(pb); /* preview duration */
> @@ -3798,9 +3804,24 @@ static int mov_read_meta(MOVContext *c, AVIOContext 
> *pb, MOVAtom atom)
>  return 0;
>  }
>  
> +// return 0 when matrix is identity, 1 otherwise
> +#define IS_MATRIX_FULL(matrix)   \
> +(matrix[0][0] != (1 << 16) ||\
> + matrix[1][1] != (1 << 16) ||\
> + matrix[2][2] != (1 << 30) ||\
> + matrix[0][1] || matrix[0][2] || \
> + matrix[1][0] || matrix[1][2] || \
> + matrix[2][0] || matrix[2][1])
> +
> +// fixed point to int64_t
> +#define CONV_FP2INT(x, sh) ((int64_t) (x)) / (1 << sh)
> +
> +// int64_t to fixed point
> +#define CONV_INT2FP(x, sh) (int32_t) ((x) * (1 << sh))
> +
>  static int mov_read_tkhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>  {
> -int i;
> +int i, j, e;
>  int width;
>  int height;
>  int display_matrix[3][3];
> @@ -3855,13 +3876,7 @@ static int mov_read_tkhd(MOVContext *c, AVIOContext 
> *pb, MOVAtom atom)
>  
>  // save the matrix and add rotate metadata when it is not the default
>  // identity
> -if (display_matrix[0][0] != (1 << 16) ||
> -display_matrix[1][1] != (1 << 16) ||
> -display_matrix[2][2] != (1 << 30) ||
> -display_matrix[0][1] || display_matrix[0][2] ||
> -display_matrix[1][0] || display_matrix[1][2] ||
> -display_matrix[2][0] || display_matrix[2][1]) {
> -int i, j;
> +if (IS_MATRIX_FULL(display_matrix)) {
>  double rotate;
>  
>  av_freep(>display_matrix);
> @@ -3884,13 +3899,41 @@ static int mov_read_tkhd(MOVContext *c, AVIOContext 
> *pb, MOVAtom atom)
>  }
>  }
>  
> +// if movie display matrix is not identity, and if this is a video track
> +if (IS_MATRIX_FULL(c->movie_display_matrix) && width && height) {
> +// if trak display matrix was identity, just copy the movie one
> +if (!sc->display_matrix) {
> +sc->display_matrix = av_malloc(sizeof(int32_t) * 9);
> +if (!sc->display_matrix)
> +return AVERROR(ENOMEM);
> +
> +for (i = 0; i < 3; i++)
> +for (j = 0; j < 3; j++)
> +sc->display_matrix[i * 3 + j] = 
> c->movie_display_matrix[i][j];

> +} else { // otherwise multiply the two and store the result
> +int64_t val = 0;
> +for (i = 0; i < 3; i++) {
> +for (j = 0; j < 3; j++) {
> +int sh = j == 2 ? 30 : 16;
> +for (e = 0; e < 3; e++) {
> +val += CONV_FP2INT(display_matrix[i][e], sh) *
> +   

Re: [FFmpeg-devel] [PATCH] mov: Evaluate the movie display matrix

2016-10-07 Thread Carl Eugen Hoyos
2016-10-06 22:40 GMT+02:00 Vittorio Giovara :
>>> https://www.dropbox.com/s/w2uu37o11rvoz1q/moviedispmat.mp4?dl=1

>> what is the intended / correct SAR / DAR for this sample ?
>
> without the patch Stream #0:0(und): Video: h264 (High) (avc1 /
> 0x31637661), yuv420p, 540x576 [SAR 1:1 DAR 15:16], 102 kb/s, 25 fps,
> 25 tbr, 12800 tbn, 50 tbc (default)
>
> with the patch Stream #0:0(und): Video: h264 (High) (avc1 /
> 0x31637661), yuv420p, 540x576 [SAR 1:1 DAR 15:16], 102 kb/s, SAR
> 93207:65536 DAR 1016804:762601, 25 fps, 25 tbr, 12800 tbn, 50 tbc
> (default)
>
> This last one is the intended and correct one.

Which application (except patched FFmpeg) allows to reproduce this?

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


Re: [FFmpeg-devel] [PATCH] mov: Evaluate the movie display matrix

2016-10-06 Thread Michael Niedermayer
On Wed, Oct 05, 2016 at 05:25:33PM -0400, Vittorio Giovara wrote:
> This matrix needs to be applied after all others have (currently only
> display matrix from trak), but cannot be handled in movie box, since
> streams are not allocated yet.
> 
> So store it in main context and if not identity, apply it when appropriate,
> handling the case when trak display matrix is identity and when it is not.
> 
> Signed-off-by: Vittorio Giovara 
> ---
> Please keep my in CC.
> Vittorio
> 
>  libavformat/isom.h |  2 ++
>  libavformat/mov.c  | 63 
> +-
>  2 files changed, 55 insertions(+), 10 deletions(-)
> 
> diff --git a/libavformat/isom.h b/libavformat/isom.h
> index 2246fed..2aeb8fa 100644
> --- a/libavformat/isom.h
> +++ b/libavformat/isom.h
> @@ -238,6 +238,8 @@ typedef struct MOVContext {
>  uint8_t *decryption_key;
>  int decryption_key_len;
>  int enable_drefs;
> +
> +int32_t movie_display_matrix[3][3]; ///< display matrix from mvhd
>  } MOVContext;
>  
>  int ff_mp4_read_descr_len(AVIOContext *pb);
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index a15c8d1..26b332c 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -1211,6 +1211,7 @@ static int mov_read_mdhd(MOVContext *c, AVIOContext 
> *pb, MOVAtom atom)
>  
>  static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>  {
> +int i;
>  int64_t creation_time;
>  int version = avio_r8(pb); /* version */
>  avio_rb24(pb); /* flags */
> @@ -1238,7 +1239,12 @@ static int mov_read_mvhd(MOVContext *c, AVIOContext 
> *pb, MOVAtom atom)
>  
>  avio_skip(pb, 10); /* reserved */
>  
> -avio_skip(pb, 36); /* display matrix */
> +/* movie display matrix, store it in main context and use it later on */
> +for (i = 0; i < 3; i++) {
> +c->movie_display_matrix[i][0] = avio_rb32(pb); // 16.16 fixed point
> +c->movie_display_matrix[i][1] = avio_rb32(pb); // 16.16 fixed point
> +c->movie_display_matrix[i][2] = avio_rb32(pb); //  2.30 fixed point
> +}
>  
>  avio_rb32(pb); /* preview time */
>  avio_rb32(pb); /* preview duration */
> @@ -3798,9 +3804,24 @@ static int mov_read_meta(MOVContext *c, AVIOContext 
> *pb, MOVAtom atom)
>  return 0;
>  }
>  
> +// return 0 when matrix is identity, 1 otherwise
> +#define IS_MATRIX_FULL(matrix)   \
> +(matrix[0][0] != (1 << 16) ||\
> + matrix[1][1] != (1 << 16) ||\
> + matrix[2][2] != (1 << 30) ||\
> + matrix[0][1] || matrix[0][2] || \
> + matrix[1][0] || matrix[1][2] || \
> + matrix[2][0] || matrix[2][1])
> +
> +// fixed point to double
> +#define CONV_FP(x, sh) ((double) (x)) / (1 << sh)
> +
> +// double to fixed point
> +#define CONV_DB(x, sh) (int32_t) ((x) * (1 << sh))
> +
>  static int mov_read_tkhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>  {
> -int i;
> +int i, j, e;
>  int width;
>  int height;
>  int display_matrix[3][3];
> @@ -3855,13 +3876,7 @@ static int mov_read_tkhd(MOVContext *c, AVIOContext 
> *pb, MOVAtom atom)
>  
>  // save the matrix and add rotate metadata when it is not the default
>  // identity
> -if (display_matrix[0][0] != (1 << 16) ||
> -display_matrix[1][1] != (1 << 16) ||
> -display_matrix[2][2] != (1 << 30) ||
> -display_matrix[0][1] || display_matrix[0][2] ||
> -display_matrix[1][0] || display_matrix[1][2] ||
> -display_matrix[2][0] || display_matrix[2][1]) {
> -int i, j;
> +if (IS_MATRIX_FULL(display_matrix)) {
>  double rotate;
>  
>  av_freep(>display_matrix);
> @@ -3884,13 +3899,41 @@ static int mov_read_tkhd(MOVContext *c, AVIOContext 
> *pb, MOVAtom atom)
>  }
>  }
>  
> +// if movie display matrix is not identity, and if this is a video track
> +if (IS_MATRIX_FULL(c->movie_display_matrix) && width && height) {
> +// if trak display matrix was identity, just copy the movie one
> +if (!sc->display_matrix) {
> +sc->display_matrix = av_malloc(sizeof(int32_t) * 9);
> +if (!sc->display_matrix)
> +return AVERROR(ENOMEM);
> +
> +for (i = 0; i < 3; i++)
> +for (j = 0; j < 3; j++)
> +sc->display_matrix[i * 3 + j] = 
> c->movie_display_matrix[i][j];
> +} else { // otherwise multiply the two and store the result
> +double val = 0;
> +for (i = 0; i < 3; i++) {
> +for (j = 0; j < 3; j++) {
> +int sh = j == 2 ? 30 : 16;
> +for (e = 0; e < 3; e++) {
> +val += CONV_FP(display_matrix[i][e], sh) *
> +   CONV_FP(c->movie_display_matrix[e][j], sh);
> +}
> +sc->display_matrix[i * 3 + j] = CONV_DB(val, sh);
> +val = 0;

the matrixes are 32bit the product of 

Re: [FFmpeg-devel] [PATCH] mov: Evaluate the movie display matrix

2016-10-06 Thread compn
On Thu, 6 Oct 2016 16:40:12 -0400
Vittorio Giovara  wrote:

> > what is the intended / correct SAR / DAR for this sample ?
> 
> without the patch Stream #0:0(und): Video: h264 (High) (avc1 /
> 0x31637661), yuv420p, 540x576 [SAR 1:1 DAR 15:16], 102 kb/s, 25 fps,
> 25 tbr, 12800 tbn, 50 tbc (default)
> 
> with the patch Stream #0:0(und): Video: h264 (High) (avc1 /
> 0x31637661), yuv420p, 540x576 [SAR 1:1 DAR 15:16], 102 kb/s, SAR
> 93207:65536 DAR 1016804:762601, 25 fps, 25 tbr, 12800 tbn, 50 tbc
> (default)
> 
> This last one is the intended and correct one.

why are SAR and DAR in the output twice now? it might be confusing to
users? or just me...

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


Re: [FFmpeg-devel] [PATCH] mov: Evaluate the movie display matrix

2016-10-06 Thread Michael Niedermayer
On Thu, Oct 06, 2016 at 12:12:07AM -0400, Vittorio Giovara wrote:
> On Wed, Oct 5, 2016 at 10:07 PM, Michael Niedermayer
>  wrote:
> > On Wed, Oct 05, 2016 at 05:25:33PM -0400, Vittorio Giovara wrote:
> >> This matrix needs to be applied after all others have (currently only
> >> display matrix from trak), but cannot be handled in movie box, since
> >> streams are not allocated yet.
> >>
> >> So store it in main context and if not identity, apply it when appropriate,
> >> handling the case when trak display matrix is identity and when it is not.
> >
> > do you have a testcase for this which you can share ?
> >
> > thx
> >
> > [...]
> > --
> 
> I created one for the occasion
> https://www.dropbox.com/s/w2uu37o11rvoz1q/moviedispmat.mp4?dl=1

with ffplay before the patch the image looks round, after the patch
it looks quite squished, is that intended ?
what is the intended / correct SAR / DAR for this sample ?

thx

[...]
-- 
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


Re: [FFmpeg-devel] [PATCH] mov: Evaluate the movie display matrix

2016-10-05 Thread Vittorio Giovara
On Wed, Oct 5, 2016 at 10:07 PM, Michael Niedermayer
 wrote:
> On Wed, Oct 05, 2016 at 05:25:33PM -0400, Vittorio Giovara wrote:
>> This matrix needs to be applied after all others have (currently only
>> display matrix from trak), but cannot be handled in movie box, since
>> streams are not allocated yet.
>>
>> So store it in main context and if not identity, apply it when appropriate,
>> handling the case when trak display matrix is identity and when it is not.
>
> do you have a testcase for this which you can share ?
>
> thx
>
> [...]
> --

I created one for the occasion
https://www.dropbox.com/s/w2uu37o11rvoz1q/moviedispmat.mp4?dl=1
-- 
Vittorio
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel