[FFmpeg-devel] [PATCH] libavcodec: use 64bit counter in deprecated audio encoder API to prevent problems regarding negative dts

Michael Niedermayer michaelni at gmx.at
Fri Jul 5 13:50:42 CEST 2013


On Thu, Jul 04, 2013 at 07:02:21PM +0200, Peter Große wrote:
> Hello.
> 
> We are using the the libavformat consumer of melt (http://www.mltframework.org)
> for RTMP livestream encoding. After several hours a warning occurs in the
> libavformat muxer and the encoding crashes:
> 
>  [aac @ 0x26f76c0] Que input is backward in time
>  [flv @ 0x26d9580] Application provided invalid, non monotonically increasing
>  dts to muxer in stream 1: 48695751 >= -48695774
> 
> The dts counter seems to count milliseconds, since the problem occurs
> reproducible after 13h32m.
> 
> While debugging the issue we noticed melt uses the old avcodec_encode_audio
> API, which is deprecated for over a year now. The commit [1] introducing the
> compatibility API adds a 32 bit integer "sample_count" to AVCodecInternal
> (libavcodec/internal.h) used for computing the pts (64bit).
> 
> We think that causes the problem, since changing the counter type to int64_t
> fixes the problem for us. See patch attached.
> 
> For debugging purposes a 15h silent audio track was generated using ffmpeg
> with /dev/zero as input.
> 
> This patch is also attached to a bug report I created:
> https://trac.ffmpeg.org/ticket/2752
> 
> Kind regards
> Peter Große
> 
> [1]
> http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=b2c75b6e6320b1a399d76913f9d98c56f386f98b

>  internal.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> e8d8c90f8ace0fcd4845e93d171ad510236cba3f  ffmpeg-1.2.1-64bit-samplecount.patch

applied

thanks

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130705/c6466100/attachment.asc>


More information about the ffmpeg-devel mailing list