Opened 11 years ago

Last modified 10 years ago

#2693 new defect

-async chokes on damaged audio input stream

Reported by: Jean Delvare Owned by:
Priority: normal Component: avfilter
Version: git-master Keywords: regression async
Cc: mikie@iki.fi Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

I am doing a lot of DVB-T recordings which I then re-encode using ffmpeg. I always pass -async 24000 to deal with random reception errors which can result in damaged audio or video streams from times to times. It works well with ffmpeg 1.0.6 from my Linux distribution (openSUSE 12.3) but fails with my self-built ffmpeg version from the git repository.

How to reproduce:

% ffmpeg -i audio_error.mpg -codec:v libxvid -b:v 1024k -codec:a libmp3lame -b:a 128k -af aresample=async=24000:first_pts=0 audio_error.avi
ffmpeg version N-54111-gddefb80 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jun 19 2013 14:13:45 with gcc 4.7 (SUSE Linux)
  configuration: --prefix=/opt/ffmpeg --enable-shared --enable-libmp3lame --enable-libxvid --enable-postproc --enable-gpl --enable-x11grab --enable-avfilter --enable-version3 --enable-libx264 --enable-pthreads --enable-libvorbis --enable-libtheora --enable-fontconfig --cpu=corei7
  libavutil      52. 37.101 / 52. 37.101
  libavcodec     55. 16.100 / 55. 16.100
  libavformat    55.  9.100 / 55.  9.100
  libavdevice    55.  2.100 / 55.  2.100
  libavfilter     3. 77.101 /  3. 77.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mpeg, from 'audio_error.mpg':
  Duration: 00:00:02.81, start: 0.252622, bitrate: 3777 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 25.33 fps, 25 tbr, 90k tbn, 100 tbc
    Stream #0:1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16p, 192 kb/s
Output #0, avi, to 'audio_error.avi':
  Metadata:
    ISFT            : Lavf55.9.100
    Stream #0:0: Video: mpeg4 (libxvid) (xvid / 0x64697678), yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=2-31, 1024 kb/s, 25 tbn, 25 tbc
    Stream #0:1: Audio: mp3 (libmp3lame) (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video -> libxvid)
  Stream #0:1 -> #0:1 (mp2 -> libmp3lame)
Press [q] to stop, [?] for help
[mp2 @ 0x936dc0] Header missing
Error while decoding stream #0:1: Invalid data found when processing input
[libmp3lame @ 0x937240] Queue input is backward in time
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 91, current: 0; changing to 92. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 92, current: 1; changing to 93. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 93, current: 2; changing to 94. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 94, current: 3; changing to 95. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 95, current: 4; changing to 96. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 96, current: 5; changing to 97. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 97, current: 6; changing to 98. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 98, current: 7; changing to 99. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 99, current: 8; changing to 100. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 100, current: 9; changing to 101. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 101, current: 10; changing to 102. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 102, current: 11; changing to 103. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 103, current: 12; changing to 104. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 104, current: 13; changing to 105. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 105, current: 14; changing to 106. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 106, current: 15; changing to 107. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 107, current: 16; changing to 108. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 108, current: 17; changing to 109. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 109, current: 18; changing to 110. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 110, current: 19; changing to 111. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 111, current: 20; changing to 112. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 112, current: 21; changing to 113. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 113, current: 22; changing to 114. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 114, current: 23; changing to 115. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 115, current: 24; changing to 116. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 116, current: 25; changing to 117. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 117, current: 26; changing to 118. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 118, current: 27; changing to 119. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 119, current: 28; changing to 120. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 120, current: 29; changing to 121. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 121, current: 30; changing to 122. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 122, current: 31; changing to 123. This may result in incorrect timestamps in the output file.
Non-monotonous DTS in output stream 0:1; previous: 123, current: 32; changing to 124. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 124, current: 33; changing to 125. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 125, current: 34; changing to 126. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 126, current: 35; changing to 127. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 127, current: 36; changing to 128. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 128, current: 37; changing to 129. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 129, current: 38; changing to 130. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 130, current: 39; changing to 131. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 131, current: 40; changing to 132. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 132, current: 41; changing to 133. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 133, current: 42; changing to 134. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 134, current: 43; changing to 135. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 135, current: 44; changing to 136. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 136, current: 45; changing to 137. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 137, current: 46; changing to 138. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 138, current: 47; changing to 139. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 139, current: 48; changing to 140. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 140, current: 49; changing to 141. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 141, current: 50; changing to 142. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 142, current: 51; changing to 143. This may result in incorrect timestamps in the output file.
[mpeg2video @ 0x9343a0] 00 motion_type at 24 15
[mpeg2video @ 0x9343a0] Warning MVs not available
[mpeg2video @ 0x9343a0] concealing 90 DC, 90 AC, 90 MV errors in P frame
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 143, current: 52; changing to 144. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 144, current: 53; changing to 145. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 145, current: 54; changing to 146. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 146, current: 55; changing to 147. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 147, current: 56; changing to 148. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 148, current: 61; changing to 149. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 149, current: 62; changing to 150. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 150, current: 63; changing to 151. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 151, current: 64; changing to 152. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 152, current: 65; changing to 153. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 153, current: 66; changing to 154. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 154, current: 67; changing to 155. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 155, current: 68; changing to 156. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 156, current: 69; changing to 157. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 157, current: 70; changing to 158. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 158, current: 71; changing to 159. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 159, current: 72; changing to 160. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 160, current: 73; changing to 161. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 161, current: 74; changing to 162. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 162, current: 75; changing to 163. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 163, current: 76; changing to 164. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 164, current: 77; changing to 165. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 165, current: 78; changing to 166. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 166, current: 79; changing to 167. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 167, current: 80; changing to 168. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 168, current: 81; changing to 169. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 169, current: 82; changing to 170. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 170, current: 83; changing to 171. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 171, current: 84; changing to 172. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 172, current: 85; changing to 173. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 173, current: 86; changing to 174. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 174, current: 87; changing to 175. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 175, current: 88; changing to 176. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 176, current: 89; changing to 177. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 177, current: 90; changing to 178. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 178, current: 91; changing to 179. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 179, current: 92; changing to 180. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 180, current: 93; changing to 181. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 181, current: 94; changing to 182. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 182, current: 95; changing to 183. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 183, current: 96; changing to 184. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 184, current: 97; changing to 185. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 185, current: 98; changing to 186. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 186, current: 99; changing to 187. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 187, current: 100; changing to 188. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 188, current: 101; changing to 189. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 189, current: 102; changing to 190. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 190, current: 103; changing to 191. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 191, current: 104; changing to 192. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 192, current: 105; changing to 193. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 193, current: 106; changing to 194. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 194, current: 107; changing to 195. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 195, current: 108; changing to 196. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 196, current: 109; changing to 197. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 197, current: 110; changing to 198. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 198, current: 111; changing to 199. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 199, current: 112; changing to 200. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 200, current: 113; changing to 201. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 201, current: 114; changing to 202. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 202, current: 115; changing to 203. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 203, current: 116; changing to 204. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 204, current: 117; changing to 205. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 205, current: 118; changing to 206. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 206, current: 119; changing to 207. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 207, current: 120; changing to 208. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 208, current: 121; changing to 209. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 209, current: 122; changing to 210. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 210, current: 123; changing to 211. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 211, current: 124; changing to 212. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 212, current: 125; changing to 213. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 213, current: 126; changing to 214. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 214, current: 127; changing to 215. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 215, current: 128; changing to 216. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 216, current: 129; changing to 217. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 217, current: 130; changing to 218. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 218, current: 131; changing to 219. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 219, current: 132; changing to 220. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 220, current: 133; changing to 221. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 221, current: 134; changing to 222. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 222, current: 135; changing to 223. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 223, current: 136; changing to 224. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 224, current: 137; changing to 225. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 225, current: 138; changing to 226. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 226, current: 139; changing to 227. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 227, current: 140; changing to 228. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 228, current: 141; changing to 229. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 229, current: 142; changing to 230. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 230, current: 143; changing to 231. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 231, current: 144; changing to 232. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 232, current: 145; changing to 233. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 233, current: 146; changing to 234. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 234, current: 147; changing to 235. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 235, current: 148; changing to 236. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 236, current: 149; changing to 237. This may result in incorrect timestamps in the output file.
[libmp3lame @ 0x937240] Queue input is backward in time
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 237, current: 150; changing to 238. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 238, current: 151; changing to 239. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 239, current: 152; changing to 240. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 240, current: 153; changing to 241. This may result in incorrect timestamps in the output file.
[avi @ 0x9351c0] Non-monotonous DTS in output stream 0:1; previous: 241, current: 151; changing to 242. This may result in incorrect timestamps in the output file.
frame=   71 fps=0.0 q=4.0 Lsize=     491kB time=00:00:05.83 bitrate= 689.5kbits/s    
video:382kB audio:92kB subtitle:0 global headers:0kB muxing overhead 3.636487%

As you can see, everything is fine until the error in the audio stream. After that I get a flood of warning messages. I have tracked it down to the combination of options async>1 and first_pts=0 in audio filter aresample.

Not only the warning flood is unpleasant (it can easily hide other issues) but more importantly the audio if completely out of synchro after that point. In fact it is way worse than if I do not use -async.

I noticed that -af aresample=async24000 alone seems to work fine, at least in this case.

ffmpeg 1.0.6 translates -async 24000 to a different aresample parameter set, which explains why there is no such problem there.

Attachments (1)

audio_error.mpg (2.2 MB ) - added by Jean Delvare 11 years ago.
Sample to reproduce the bug

Change History (11)

by Jean Delvare, 11 years ago

Attachment: audio_error.mpg added

Sample to reproduce the bug

comment:1 by Carl Eugen Hoyos, 11 years ago

Are libxvid or libmp3lame required to reproduce your problem? If not, please only use native codecs to allow reproducing tickets (FFmpeg does not show the version of external libraries).

I tested the following command line:
$ ffmpeg -i audio_error.mpg -qscale 2 out.avi
The output appears to play without desync afaict, am I missing something?

comment:2 by Jean Delvare, 11 years ago

Sorry, libxvid and libmp3lame aren't required, these simply happen to be what my script was using. I had not realized that the -codec parameters could be omitted. I'll try to remember that for my future bug reports.

You are right that
$ ffmpeg -i audio_error.mpg -qscale 2 out.avi
sounds OK, although there could be some minor desynchro between audio and video, but too small to notice.

Anyway, I am always passing -async 24000 because it has proven useful in the past for recordings which were more damaged than this sample (usually video only is damaged.) And the problem is that:
$ ffmpeg -i audio_error.mpg -qscale 2 -async 24000 out.avi
is not OK at all.

in reply to:  2 comment:3 by Carl Eugen Hoyos, 11 years ago

Replying to khali:

Anyway, I am always passing -async 24000 because it has proven useful in the past for recordings which were more damaged than this sample

Could you provide such a sample?
I do understand that you are reporting a regression for a specific option, but if that option is never needed (anymore) then this is hardly important.

comment:4 by Jean Delvare, 11 years ago

I investigated this further and there are actually two different issues here.

  1. The log message flood. It happens with the git version of ffmpeg as soon as -async 24000 (or -af aresample=async=24000,first_pts=0) is passed. It never happens with ffmpeg 1.0.6.
  2. The audio gets out of sync. I can only reproduce this with 2-pass encoding using an AVI output container. When the input file is damaged, 2-pass encoding may lead to out-of-sync audio. With ffmpeg 1.0.6, passing -async 24000 fixes it. With ffmpeg from git, passing -async 24000 doesn't fix it and even makes it worse.

The sample file I attached to this bug doesn't trigger the second bug, but I have another one which does. Unfortunately it is much larger so I can't attach it here. I'll upload it to upload.ffmpeg.org.

comment:5 by Carl Eugen Hoyos, 11 years ago

Could you test the following command line? It works fine here for your sample with current git head and I would expect it to also work with older versions but I may miss something (and I can't test your exact options atm).
$ ffmpeg -async 1 -i ffmpeg-trac-2693-part2.mpg -qscale 2 out.avi

comment:6 by Carl Eugen Hoyos, 11 years ago

Keywords: async added

Looks related to tickets #2210 and #2309.

in reply to:  5 ; comment:7 by Jean Delvare, 11 years ago

Replying to cehoyos:

Could you test the following command line? It works fine here for your sample with current git head and I would expect it to also work with older versions but I may miss something (and I can't test your exact options atm).
$ ffmpeg -async 1 -i ffmpeg-trac-2693-part2.mpg -qscale 2 out.avi

Using -async 1 instead of -async 24000 solves both issues, yes. The warning flood is gone (which is no surprise, as I already stated in the original bug description that it only happened with async>1). And the audio in in sync, at least in this sample. I seem to recall that -async 1 did not properly fix all my recordings but that was long ago, maybe it will work with ffmpeg 1.0.6 and later.

Thanks for the suggestion, this will let me work around the issue for now. But the bug is still present.

in reply to:  7 comment:8 by Carl Eugen Hoyos, 11 years ago

Replying to khali:

I seem to recall that -async 1 did not properly fix all my recordings

Such a sample would be very welcome!
(Even if it only fails with older versions, that would still allow to better understand the issue.)

But the bug is still present.

Imo, this is only a documentation issue, but I will leave the ticket open.

comment:9 by Mika Raento, 10 years ago

Cc: mikie@iki.fi added

comment:10 by Mika Raento, 10 years ago

Cc: mikie@iki.fi added
Note: See TracTickets for help on using tickets.