Opened 9 years ago

Closed 9 years ago

#4203 closed defect (worksforme)

"Non-monotonous DTS in output stream": pulseaudio issue?

Reported by: Daniel Fraga Owned by:
Priority: normal Component: ffmpeg
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I get the following with GIT:

ffmpeg started on 2014-12-22 at 21:01:46
Report written to "ffmpeg-20141222-210146.log"
Command line:
/usr/local/bin/ffmpeg -report -xerror -loglevel info -f x11grab -framerate 25 -video_size 1920x1200 -i :0.0+0,0 -dcodec copy -f alsa -i pulse -audio_service_type co -vol 512 -vcodec libx264 -acodec libmp3lame -y /home/fraga/src/qx11grab.mp4
ffmpeg version N-68650-gfe439c2 Copyright (c) 2000-2014 the FFmpeg developers

built on Dec 22 2014 20:35:32 with gcc 4.9.2 (GCC)
configuration: --enable-shared --extra-ldflags=-L/usr/local/lib64 --enable-gpl --enable-postproc --enable-x11grab --enable-libx264 --enable-libx265 --enable-libvorbis --enable-nonfree --enable-libfaac --enable-libmp3lame --enable-libbluray --disable-ffserver --enable-libvpx --enable-libpulse
libavutil 54. 15.100 / 54. 15.100
libavcodec 56. 16.100 / 56. 16.100
libavformat 56. 16.101 / 56. 16.101
libavdevice 56. 3.100 / 56. 3.100
libavfilter 5. 4.100 / 5. 4.100
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100

Splitting the commandline.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-xerror' ... matched as option 'xerror' (exit on error) with argument '1'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'info'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'x11grab'.
Reading option '-framerate' ... matched as AVOption 'framerate' with argument '25'.
Reading option '-video_size' ... matched as AVOption 'video_size' with argument '1920x1200'.
Reading option '-i' ... matched as input file with argument ':0.0+0,0'.
Reading option '-dcodec' ... matched as option 'dcodec' (force data codec ('copy' to copy stream)) with argument 'copy'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'alsa'.
Reading option '-i' ... matched as input file with argument 'pulse'.
Reading option '-audio_service_type' ... matched as AVOption 'audio_service_type' with argument 'co'.
Reading option '-vol' ... matched as option 'vol' (change audio volume (256=normal)) with argument '512'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'libx264'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'libmp3lame'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '/home/fraga/src/qx11grab.mp4' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Applying option xerror (exit on error) with argument 1.
Applying option loglevel (set logging level) with argument info.
Applying option vol (change audio volume (256=normal)) with argument 512.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file :0.0+0,0.
Applying option f (force format) with argument x11grab.
Successfully parsed a group of options.
Opening an input file: :0.0+0,0.
[x11grab @ 0x9d1980] All info found
Input #0, x11grab, from ':0.0+0,0':

Duration: N/A, start: 1419289306.274129, bitrate: N/A

Stream #0:0, 1, 1/1000000: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1920x1200, 25 fps, 25 tbr, 1000k tbn, 25 tbc

Successfully opened the file.
Parsing a group of options: input file pulse.
Applying option dcodec (force data codec ('copy' to copy stream)) with argument copy.
Applying option f (force format) with argument alsa.
Successfully parsed a group of options.
Opening an input file: pulse.
[alsa @ 0x9d8c40] All info found
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, alsa, from 'pulse':

Duration: N/A, start: 1419289306.287454, bitrate: 1536 kb/s

Stream #1:0, 1, 1/1000000: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s

Successfully opened the file.
Parsing a group of options: output file /home/fraga/src/qx11grab.mp4.
Applying option vcodec (force video codec ('copy' to copy stream)) with argument libx264.
Applying option acodec (force audio codec ('copy' to copy stream)) with argument libmp3lame.
Successfully parsed a group of options.
Opening an output file: /home/fraga/src/qx11grab.mp4.
Successfully opened the file.
detected 8 logical cores
[graph 0 input from stream 0:0 @ 0x9c7ca0] Setting 'video_size' to value '1920x1200'
[graph 0 input from stream 0:0 @ 0x9c7ca0] Setting 'pix_fmt' to value '298'
[graph 0 input from stream 0:0 @ 0x9c7ca0] Setting 'time_base' to value '1/1000000'
[graph 0 input from stream 0:0 @ 0x9c7ca0] Setting 'pixel_aspect' to value '0/1'
[graph 0 input from stream 0:0 @ 0x9c7ca0] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 0x9c7ca0] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 0x9c7ca0] w:1920 h:1200 pixfmt:bgr0 tb:1/1000000 fr:25/1 sar:0/1 sws_param:flags=2
[format @ 0x9c7ec0] compat: called with args=[yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p|nv12|nv16]
[format @ 0x9c7ec0] Setting 'pix_fmts' to value 'yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p|nv12|nv16'
[auto-inserted scaler 0 @ 0xa1a400] Setting 'flags' to value '0x4'
[auto-inserted scaler 0 @ 0xa1a400] w:iw h:ih flags:'0x4' interl:0
[format @ 0x9c7ec0] auto-inserting filter 'auto-inserted scaler 0' between the filter 'Parsed_null_0' and the filter 'format'
[AVFilterGraph @ 0x9c7de0] query_formats: 4 queried, 2 merged, 1 already done, 0 delayed
[auto-inserted scaler 0 @ 0xa1a400] picking yuv444p out of 7 ref:bgr0 alpha:0
[auto-inserted scaler 0 @ 0xa1a400] w:1920 h:1200 fmt:bgr0 sar:0/1 -> w:1920 h:1200 fmt:yuv444p sar:0/1 flags:0x4
No pixel format specified, yuv444p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[graph 1 input from stream 1:0 @ 0xa1a300] Setting 'time_base' to value '1/48000'
[graph 1 input from stream 1:0 @ 0xa1a300] Setting 'sample_rate' to value '48000'
[graph 1 input from stream 1:0 @ 0xa1a300] Setting 'sample_fmt' to value 's16'
[graph 1 input from stream 1:0 @ 0xa1a300] Setting 'channel_layout' to value '0x3'
[graph 1 input from stream 1:0 @ 0xa1a300] tb:1/48000 samplefmt:s16 samplerate:48000 chlayout:0x3
-vol has been deprecated. Use the volume audio filter instead.
-vol is forwarded to lavfi similarly to -af volume=2.000000.
[graph 1 volume for input stream 1:0 @ 0x9b2b20] Setting 'volume' to value '2.000000'
[audio format for output stream 0:1 @ 0x9ac1e0] Setting 'sample_fmts' to value 's32p|fltp|s16p'
[audio format for output stream 0:1 @ 0x9ac1e0] Setting 'sample_rates' to value '44100|48000|32000|22050|24000|16000|11025|12000|8000'
[audio format for output stream 0:1 @ 0x9ac1e0] Setting 'channel_layouts' to value '0x4|0x3'
[graph 1 volume for input stream 1:0 @ 0x9b2b20] auto-inserting filter 'auto-inserted resampler 0' between the filter 'graph 1 input from stream 1:0' and the filter 'graph 1 volume for input stream 1:0'
[AVFilterGraph @ 0x9b3a00] query_formats: 5 queried, 9 merged, 3 already done, 0 delayed
[auto-inserted resampler 0 @ 0xa27c40] ch:2 chl:stereo fmt:s16 r:48000Hz -> ch:2 chl:stereo fmt:fltp r:48000Hz
[auto-inserted resampler 0 @ 0xa27c40] tb:0.000021 sample_rate:48000.000000 nb_channels:2.000000
[graph 1 volume for input stream 1:0 @ 0x9b2b20] n:nan t:nan pts:nan precision:float volume:2.000000 volume_dB:6.020600
[libx264 @ 0xa18800] using mv_range_thread = 40
[libx264 @ 0xa18800] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0xa18800] profile High 4:4:4 Predictive, level 5.0, 4:4:4 8-bit
[libx264 @ 0xa18800] 264 - core 144 r2525 40bb568 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=4 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/home/fraga/src/qx11grab.mp4':

Metadata:

encoder : Lavf56.16.101
Stream #0:0, 0, 1/12800: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv444p, 1920x1200, q=-1--1, 25 fps, 12800 tbn, 25 tbc
Metadata:

encoder : Lavc56.16.100 libx264

Stream #0:1, 0, 1/48000: Audio: mp3 (libmp3lame) (i[0][0][0] / 0x0069), 48000 Hz, stereo, fltp
Metadata:

encoder : Lavc56.16.100 libmp3lame

Stream mapping:

Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Stream #1:0 -> #0:1 (pcm_s16le (native) -> mp3 (libmp3lame))

Press [q] to stop, ? for help
frame= 14 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A Mframe= 28 fps= 27 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A Mframe= 40 fps= 26 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A Mframe= 53 fps= 26 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A M[libx264 @ 0xa18800] frame= 0 QP=24.66 NAL=3 Slice:I Poc:0 I:9000 P:0 SKIP:0 size=176823 bytes
[libx264 @ 0xa18800] frame= 1 QP=27.49 NAL=2 Slice:P Poc:2 I:3807 P:357 SKIP:4836 size=155402 bytes
[libx264 @ 0xa18800] frame= 2 QP=20.07 NAL=2 Slice:P Poc:4 I:3446 P:603 SKIP:4951 size=206487 bytes
[libx264 @ 0xa18800] frame= 3 QP=23.09 NAL=2 Slice:P Poc:12 I:56 P:1271 SKIP:7673 size=12114 bytes
[libmp3lame @ 0xa1c380] Queue input is backward in time
[libmp3lame @ 0xa1c380] Queue input is backward in time
[mp4 @ 0xa17780] Non-monotonous DTS in output stream 0:1; previous: 47, current: -2463; aborting.
[AVIOContext @ 0xa15540] Statistics: 0 seeks, 21 writeouts
[libx264 @ 0xa18800] frame I:1 Avg QP:24.66 size:176823
[libx264 @ 0xa18800] frame P:3 Avg QP:23.55 size:124668
[libx264 @ 0xa18800] mb I I16..4: 34.9% 28.6% 36.5%
[libx264 @ 0xa18800] mb P I16..4: 2.5% 6.4% 18.2% P16..4: 5.8% 1.1% 1.3% 0.0% 0.0% skip:64.7%
[libx264 @ 0xa18800] 8x8 transform intra:26.4% inter:7.5%
[libx264 @ 0xa18800] coded y,u,v intra: 37.2% 7.0% 6.5% inter: 4.8% 0.5% 0.6%
[libx264 @ 0xa18800] i16 v,h,dc,p: 74% 25% 1% 0%
[libx264 @ 0xa18800] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 77% 8% 15% 0% 0% 0% 0% 0% 0%
[libx264 @ 0xa18800] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 44% 22% 16% 2% 4% 2% 4% 2% 3%
[libx264 @ 0xa18800] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0xa18800] ref P L0: 74.1% 12.4% 13.4% 0.1%
[libx264 @ 0xa18800] kb/s:27541.30
[libmp3lame @ 0xa1c380] 4 frames left in the queue on closing
Conversion failed!


If I grab just the video (not audio), it works fine, like in:

/usr/local/bin/ffmpeg -xerror -loglevel info -f x11grab -framerate 25 -video_size 1920x1200 -i :0.0+0,0 -dcodec copy -vcodec libx264 -y /home/fraga/src/qx11grab.mp4

Any hints?

Change History (1)

comment:1 by Daniel Fraga, 9 years ago

Resolution: worksforme
Status: newclosed

A workaround is to use the -af aresample=async=1 parameter.

Note: See TracTickets for help on using tickets.