diff mbox

[FFmpeg-devel] ffmpeg patch for nonmonolithic increase dts error in subtitle

Message ID CAB0OVGrB3+kj9KV9QDXfLRVVbPmLgPY_NPc36YZ=VNK9mowpiA@mail.gmail.com
State Accepted
Headers show

Commit Message

Carl Eugen Hoyos June 21, 2018, 12:27 p.m. UTC
2018-06-21 13:55 GMT+02:00, Moritz Barsnick <barsnick@gmx.net>:
> On Thu, Jun 21, 2018 at 10:51:33 +0200, Carl Eugen Hoyos wrote:

>> Who wrote the patch / where did you find it?
>
> The ticket he mentioned was #4450, the patch is here:
> https://trac.ffmpeg.org/ticket/4450#comment:6

Patch attached (untested).

Thank you, Carl Eugen

Comments

Markus Kohm June 21, 2018, 2:20 p.m. UTC | #1
Am Donnerstag, 21. Juni 2018, 14:27:29 CEST schrieb Carl Eugen Hoyos:
> Patch attached (untested).

As already mentioned in my first mail I've tested the patch and it works as 
expected.

Markus

PS: Now, I know why others have warned me, that it could become very, very 
hard to send a feature request like this to ffmpeg-devel …
Carl Eugen Hoyos June 21, 2018, 3:36 p.m. UTC | #2
2018-06-21 16:20 GMT+02:00, Markus Kohm <markus.kohm@gmx.de>:
> Am Donnerstag, 21. Juni 2018, 14:27:29 CEST schrieb Carl Eugen Hoyos:
>> Patch attached (untested).
>
> As already mentioned in my first mail I've tested the patch and it works as
> expected.
>
> Markus
>
> PS: Now, I know why others have warned me, that it could become very, very
> hard to send a feature request like this to ffmpeg-devel …

As in "copyright should be ignored by FFmpeg developers" or do
I misunderstand your comment?

Carl Eugen
Markus Kohm June 21, 2018, 4:01 p.m. UTC | #3
Am Donnerstag, 21. Juni 2018, 17:36:02 CEST schrieb Carl Eugen Hoyos:
> As in "copyright should be ignored by FFmpeg developers" or do
> I misunderstand your comment?

I do not understand the relation of copyright and my patch or any of my 
comments. So I cannot answer this question.

If you have a problem with the patch, it's OK. I've solved my problem. I only 
thought, that you are interested in adding this improvement to ffmpeg master. 
I always tell my users, that they should send me a message if they find a bug 
or have a feature request or an improving patch, because without such a 
message others cannot benefit from the corresponding improvement and that 
would be a shame. So I've tried to do the same as a user of ffmpeg. Seems I 
was completely wrong. My fault.

Just relax and have a nice day.
Michael Niedermayer June 21, 2018, 7:11 p.m. UTC | #4
On Thu, Jun 21, 2018 at 02:27:29PM +0200, Carl Eugen Hoyos wrote:
> 2018-06-21 13:55 GMT+02:00, Moritz Barsnick <barsnick@gmx.net>:
> > On Thu, Jun 21, 2018 at 10:51:33 +0200, Carl Eugen Hoyos wrote:
> 
> >> Who wrote the patch / where did you find it?
> >
> > The ticket he mentioned was #4450, the patch is here:
> > https://trac.ffmpeg.org/ticket/4450#comment:6
> 
> Patch attached (untested).
> 
> Thank you, Carl Eugen

>  ffmpeg.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 1b6b6990b1e8bf9885dd55431ccbe64da8553504  0001-ffmpeg-Treat-subtitles-like-audio-and-video-for-non-.patch
> From 6ff1a1c662211548ae3c8c01ddfc2775e03b2497 Mon Sep 17 00:00:00 2001
> From: Hans Carlson <forbyta at gmx.com>
> Date: Thu, 21 Jun 2018 14:24:36 +0200
> Subject: [PATCH] ffmpeg: Treat subtitles like audio and video for
>  non-monotonic dts.
> 
> Fixes ticket #4450.
> Fixes ticket #6248.
> ---
>  fftools/ffmpeg.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> index 6dfab64..8d311a9 100644
> --- a/fftools/ffmpeg.c
> +++ b/fftools/ffmpeg.c
> @@ -772,7 +772,7 @@ static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int u
>                       - FFMIN3(pkt->pts, pkt->dts, ost->last_mux_dts + 1)
>                       - FFMAX3(pkt->pts, pkt->dts, ost->last_mux_dts + 1);
>          }
> -        if ((st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO || st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) &&
> +        if ((st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO || st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO || st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) &&
>              pkt->dts != AV_NOPTS_VALUE &&
>              !(st->codecpar->codec_id == AV_CODEC_ID_VP9 && ost->stream_copy) &&
>              ost->last_mux_dts != AV_NOPTS_VALUE) {

probably ok, but please wait a day or 2 so others can comment too

[...]
Michael Niedermayer June 22, 2018, 11:14 p.m. UTC | #5
On Thu, Jun 21, 2018 at 09:11:56PM +0200, Michael Niedermayer wrote:
> On Thu, Jun 21, 2018 at 02:27:29PM +0200, Carl Eugen Hoyos wrote:
> > 2018-06-21 13:55 GMT+02:00, Moritz Barsnick <barsnick@gmx.net>:
> > > On Thu, Jun 21, 2018 at 10:51:33 +0200, Carl Eugen Hoyos wrote:
> > 
> > >> Who wrote the patch / where did you find it?
> > >
> > > The ticket he mentioned was #4450, the patch is here:
> > > https://trac.ffmpeg.org/ticket/4450#comment:6
> > 
> > Patch attached (untested).
> > 
> > Thank you, Carl Eugen
> 
> >  ffmpeg.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 1b6b6990b1e8bf9885dd55431ccbe64da8553504  0001-ffmpeg-Treat-subtitles-like-audio-and-video-for-non-.patch
> > From 6ff1a1c662211548ae3c8c01ddfc2775e03b2497 Mon Sep 17 00:00:00 2001
> > From: Hans Carlson <forbyta at gmx.com>
> > Date: Thu, 21 Jun 2018 14:24:36 +0200
> > Subject: [PATCH] ffmpeg: Treat subtitles like audio and video for
> >  non-monotonic dts.
> > 
> > Fixes ticket #4450.
> > Fixes ticket #6248.
> > ---
> >  fftools/ffmpeg.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> > index 6dfab64..8d311a9 100644
> > --- a/fftools/ffmpeg.c
> > +++ b/fftools/ffmpeg.c
> > @@ -772,7 +772,7 @@ static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int u
> >                       - FFMIN3(pkt->pts, pkt->dts, ost->last_mux_dts + 1)
> >                       - FFMAX3(pkt->pts, pkt->dts, ost->last_mux_dts + 1);
> >          }
> > -        if ((st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO || st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) &&
> > +        if ((st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO || st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO || st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) &&
> >              pkt->dts != AV_NOPTS_VALUE &&
> >              !(st->codecpar->codec_id == AV_CODEC_ID_VP9 && ost->stream_copy) &&
> >              ost->last_mux_dts != AV_NOPTS_VALUE) {
> 
> probably ok, but please wait a day or 2 so others can comment too

will apply, this patch also was on the bug tracker for a long time already

[...]
diff mbox

Patch

From 6ff1a1c662211548ae3c8c01ddfc2775e03b2497 Mon Sep 17 00:00:00 2001
From: Hans Carlson <forbyta at gmx.com>
Date: Thu, 21 Jun 2018 14:24:36 +0200
Subject: [PATCH] ffmpeg: Treat subtitles like audio and video for
 non-monotonic dts.

Fixes ticket #4450.
Fixes ticket #6248.
---
 fftools/ffmpeg.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 6dfab64..8d311a9 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -772,7 +772,7 @@  static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int u
                      - FFMIN3(pkt->pts, pkt->dts, ost->last_mux_dts + 1)
                      - FFMAX3(pkt->pts, pkt->dts, ost->last_mux_dts + 1);
         }
-        if ((st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO || st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) &&
+        if ((st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO || st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO || st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) &&
             pkt->dts != AV_NOPTS_VALUE &&
             !(st->codecpar->codec_id == AV_CODEC_ID_VP9 && ost->stream_copy) &&
             ost->last_mux_dts != AV_NOPTS_VALUE) {
-- 
1.7.10.4