[FFmpeg-trac] #6573(avformat:new): lost sound when timestamp discontinuity appears with HLC encoder

FFmpeg trac at avcodec.org
Wed Aug 23 09:27:15 EEST 2017


#6573: lost sound when timestamp discontinuity appears with HLC encoder
------------------------------------+------------------------------------
             Reporter:  krs_vital   |                    Owner:
                 Type:  defect      |                   Status:  new
             Priority:  normal      |                Component:  avformat
              Version:  git-master  |               Resolution:
             Keywords:              |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |
------------------------------------+------------------------------------

Comment (by krs_vital):

 lets se my changes of ffmpeg.c, it solve problem when signal down more
 then 10 seconds

 diff -u ./ffmpeg.c /var/db/pack/FFmpeg/ffmpeg.c
 --- ./ffmpeg.c  2017-08-22 17:43:54.319162240 +0700
 +++ /var/db/pack/FFmpeg/ffmpeg.c        2017-08-23 13:05:21.087010754
 +0700
 @@ -4389,14 +4389,21 @@
              if (delta < -1LL*dts_delta_threshold*AV_TIME_BASE ||
                  delta >  1LL*dts_delta_threshold*AV_TIME_BASE ||
                  pkt_dts + AV_TIME_BASE/10 < FFMAX(ist->pts, ist->dts)) {
 -                ifile->ts_offset -= delta;
 -                av_log(NULL, AV_LOG_DEBUG,
 +
 +                if(delta < 0){
 +                   ifile->ts_offset -= delta;
 +                }
 +                else{
 +                   ifile->ts_offset += delta;
 +                }
 +
 +               av_log(NULL, AV_LOG_DEBUG,
                         "timestamp discontinuity %"PRId64", new offset=
 %"PRId64"\n",
 -                       delta, ifile->ts_offset);
 -                pkt.dts -= av_rescale_q(delta, AV_TIME_BASE_Q,
 ist->st->time_base);
 -                if (pkt.pts != AV_NOPTS_VALUE)
 -                    pkt.pts -= av_rescale_q(delta, AV_TIME_BASE_Q,
 ist->st->time_base);
 -            }
 +                       delta, ifile->ts_offset);
 +               pkt.dts -= av_rescale_q(delta, AV_TIME_BASE_Q,
 ist->st->time_base);
 +               if (pkt.pts != AV_NOPTS_VALUE)
 +                   pkt.pts -= av_rescale_q(delta, AV_TIME_BASE_Q,
 ist->st->time_base);
 +           }
          } else {
              if ( delta < -1LL*dts_error_threshold*AV_TIME_BASE ||
                   delta >  1LL*dts_error_threshold*AV_TIME_BASE) {

--
Ticket URL: <https://trac.ffmpeg.org/ticket/6573#comment:12>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list