#4131(avfilter:new): aresample=async=1000:first_pts=0 produced out-of-sync audio with Non-monotonous DTS in output stream warnings
#4131: aresample=async=1000:first_pts=0 produced out-of-sync audio with Non- monotonous DTS in output stream warnings ------------------------------------+-------------------------------------- Reporter: mikaraento | Type: defect Status: new | Priority: normal Component: avfilter | Version: git-master Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+-------------------------------------- Summary of the bug: How to reproduce: {{{ $ FFREPORT=1 ffmpeg -y -i broken_audio.ts -af aresample=async=1000:first_pts=0 broken_audio.mp4 ffmpeg version N-67656-g9a69cd6 Copyright (c) 2000-2014 the FFmpeg developers built on Nov 15 2014 14:05:16 with Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn) }}} attaching log from FFREPORT and the input file -- Ticket URL: <https://trac.ffmpeg.org/ticket/4131> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#4131: aresample=async=1000:first_pts=0 produced out-of-sync audio with Non- monotonous DTS in output stream warnings ------------------------------------+------------------------------------ Reporter: mikaraento | Owner: Type: defect | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Comment (by mikaraento): The input file is too large for trac, uploaded to upload.ffmpeg.org instead. If I don't use first_pts, the output is fine. I would like to use first_pts in my processing pipeline to fill with silence when there is audio missing in the beginning. -- Ticket URL: <https://trac.ffmpeg.org/ticket/4131#comment:1> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#4131: aresample=async=1000:first_pts=0 produced out-of-sync audio with Non- monotonous DTS in output stream warnings ------------------------------------+------------------------------------ Reporter: mikaraento | Owner: Type: defect | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Comment (by cehoyos): I tested the following: {{{ $ ffmpeg -i broken_audio.ts -qscale 2 -vcodec mpeg4 -acodec aac -strict -2 out.mp4 }}} The output file seems to play in sync. Why do you need the aresample filter? -- Ticket URL: <https://trac.ffmpeg.org/ticket/4131#comment:2> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#4131: aresample=async=1000:first_pts=0 produced out-of-sync audio with Non- monotonous DTS in output stream warnings ------------------------------------+------------------------------------ Reporter: mikaraento | Owner: Type: defect | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Comment (by mikaraento): I'm building a generic, automated pipeline where many inputs do need aresample (and many would benefit from first_pts) - I don't know which ones before-hand. Also: this is cut from a larger file that most likely needs aresample; I just wanted to provide a reasonably minimal test case (the whole file is 5G, and the full processing takes a couple of hours with 24 cores). -- Ticket URL: <https://trac.ffmpeg.org/ticket/4131#comment:3> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#4131: aresample=async=1000:first_pts=0 produced out-of-sync audio with Non- monotonous DTS in output stream warnings ------------------------------------+------------------------------------ Reporter: mikaraento | Owner: Type: defect | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Comment (by cehoyos): Please provide a sufficiently long sample that allows to reproduce both that aresample is needed and that it does not work correctly. There is no size limit. -- Ticket URL: <https://trac.ffmpeg.org/ticket/4131#comment:4> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#4131: aresample=async=1000:first_pts=0 produced out-of-sync audio with Non- monotonous DTS in output stream warnings ------------------------------------+------------------------------------ Reporter: mikaraento | Owner: Type: defect | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Comment (by cehoyos): Why did you provide a sample that was created with FFmpeg and not the original sample? -- Ticket URL: <https://trac.ffmpeg.org/ticket/4131#comment:5> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#4131: aresample=async=1000:first_pts=0 produced out-of-sync audio with Non- monotonous DTS in output stream warnings ------------------------------------+------------------------------------ Reporter: mikaraento | Owner: Type: defect | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Comment (by mikaraento): Because it's a multi-stage pipeline and this is the step where it fails. Also: the pipeline is proprietary and I can't share all the code without getting permission. -- Ticket URL: <https://trac.ffmpeg.org/ticket/4131#comment:6> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#4131: aresample=async=1000:first_pts=0 produced out-of-sync audio with Non- monotonous DTS in output stream warnings ------------------------------------+------------------------------------ Reporter: mikaraento | Owner: Type: defect | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+------------------------------------ Comment (by cehoyos): Sorry for the misunderstanding: I did not mean the code but the original media input that produces the sample you have issues with. -- Ticket URL: <https://trac.ffmpeg.org/ticket/4131#comment:7> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#4131: aresample=async=1000:first_pts=0 produced out-of-sync audio with Non- monotonous DTS in output stream warnings -------------------------------------+------------------------------------ Reporter: Mika Raento | Owner: (none) Type: defect | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------ Comment (by Gyan): I came across this bug independently a few months ago. However, I only recently had time to look into it. Turns out it's due to the resampling context getting reinitialized and losing the state of some variables. Patch sent to the ML. Will update link here. This is a brief demo of the behaviour. Command: `ffmpeg -f lavfi -copyts -i sine=r=1000:samples_per_frame=100,asetpts='PTS+S+S*floor(ld(1)/4)+st(1,ld(1)+1)*0',atrim=end=1 -af ashowinfo@pre,aresample=async=300:first_pts=0,ashowinfo@post -f null -` Input frames (ashowinfo@pre): {{{ n:0 pts:100 pts_time:0.1 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:100 checksum:47DC65D2 n:1 pts:200 pts_time:0.2 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:100 checksum:D55C67D0 n:2 pts:300 pts_time:0.3 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:100 checksum:D55C67D0 n:3 pts:400 pts_time:0.4 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:100 checksum:D55C67D0 n:4 pts:600 pts_time:0.6 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:100 checksum:D55C67D0 n:5 pts:700 pts_time:0.7 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:100 checksum:D55C67D0 n:6 pts:800 pts_time:0.8 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:100 checksum:D55C67D0 n:7 pts:900 pts_time:0.9 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:100 checksum:D55C67D0 }}} Output frames - unpatched (ashowinfo@post): {{{ n:0 pts:0 pts_time:0 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:132 checksum:C2981F45 n:1 pts:132 pts_time:0.132 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:68 checksum:E78E468D n:2 pts:200 pts_time:0.2 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:100 checksum:D55C67D0 n:3 pts:300 pts_time:0.3 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:100 checksum:D55C67D0 n:4 pts:400 pts_time:0.4 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:100 checksum:D55C67D0 n:5 pts:0 pts_time:0 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:93 checksum:85CA5DB4 plan n:6 pts:93 pts_time:0.093 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:148 checksum:E39B24BA n:7 pts:241 pts_time:0.241 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:618 checksum:9ECE66E4 n:8 pts:859 pts_time:0.859 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:93 checksum:018B5C5C n:9 pts:952 pts_time:0.952 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:94 checksum:86695D43 n:10 pts:1046 pts_time:1.046 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:16 checksum:02470F0D }}} Output frames - patched (ashowinfo@post): {{{ n:0 pts:0 pts_time:0 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:132 checksum:C2981F45 n:1 pts:132 pts_time:0.132 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:68 checksum:E78E468D n:2 pts:200 pts_time:0.2 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:100 checksum:D55C67D0 n:3 pts:300 pts_time:0.3 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:100 checksum:D55C67D0 n:4 pts:400 pts_time:0.4 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:100 checksum:D55C67D0 n:5 pts:500 pts_time:0.5 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:93 checksum:85CA5DB4 n:6 pts:593 pts_time:0.593 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:110 checksum:A2655D0B n:7 pts:703 pts_time:0.703 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:108 checksum:95CB6F01 n:8 pts:811 pts_time:0.811 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:108 checksum:F35668B8 n:9 pts:919 pts_time:0.919 fmt:s16 channels:1 chlayout:mono rate:1000 nb_samples:18 checksum:84C2130C }}} -- Ticket URL: <https://trac.ffmpeg.org/ticket/4131#comment:8> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#4131: aresample=async=1000:first_pts=0 produced out-of-sync audio with Non- monotonous DTS in output stream warnings -------------------------------------+------------------------------------ Reporter: Mika Raento | Owner: (none) Type: defect | Status: closed Priority: normal | Component: avfilter Version: git-master | Resolution: fixed Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------ Changes (by Gyan): * status: new => closed * resolution: => fixed Comment: Fixed in be8a4f80b97222d99b4262c9230ca8a1db28973a -- Ticket URL: <https://trac.ffmpeg.org/ticket/4131#comment:9> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
participants (1)
-
FFmpeg