[FFmpeg-user] Delayed sound in screencast

Artur Łącki alacki93 at gmail.com
Wed Aug 21 14:59:19 CEST 2013


W dniu 21.08.2013 13:53, Carl Eugen Hoyos pisze:
> Artur Łącki <alacki93 <at> gmail.com> writes:
>
>> ffmpeg -f pulse -ac 2 -i default -f x11grab -r 30
>> -s 1366x768 -i :0.0 -vcodec libx264 -acodec libvorbis 
>> -y test.mkv
>> ffmpeg version 2.0.1
> Unrelated: If you are a user, please test git head 
> before posting here.
>
>> Input #0, pulse, from 'default':
>>   Duration: N/A, start: 0.019300, bitrate: 1536 kb/s
>                           ^^^^^^^^
>
>> Input #1, x11grab, from ':0.0':
>>   Duration: N/A, start: 1377024472.739504, bitrate: 1007124 kb/s
>                           ^^^^^^^^^^^^^^^^^
>
> This is the reason for desync.
> Can you try alsa?
> You can also test -use_wallclock_as_timestamps, I don't know 
> if it helps.
>
> Carl Eugen
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Now delay is smaller but sounds is "slow".

artur at laptop:~/Wideo> ffmpeg -f alsa -ac 2 -i default -f x11grab -r 30
-s 1366x768 -i :0.0 -vcodec libx264 -acodec libvorbis -y
-use_wallclock_as_timestamps 1 test.mkv
ffmpeg version 2.0.1 Copyright (c) 2000-2013 the FFmpeg developers
  built on Aug 17 2013 07:01:31 with gcc 4.7 (SUSE Linux)
  configuration: --shlibdir=/usr/lib64 --prefix=/usr
--mandir=/usr/share/man --libdir=/usr/lib64 --enable-shared
--disable-static --enable-debug --disable-stripping
--extra-cflags='-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2
-fstack-protector -funwind-tables -fasynchronous-unwind-tables -fPIC
-I/usr/include/gsm' --enable-gpl --enable-x11grab --enable-version3
--enable-pthreads --enable-avfilter --enable-libpulse --enable-libvpx
--enable-libopus --enable-libass --enable-libmp3lame --enable-libvorbis
--enable-libtheora --enable-libspeex --enable-libxvid --enable-libx264
--enable-libschroedinger --enable-libgsm --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-postproc --enable-libdc1394
--enable-librtmp --enable-libfreetype --enable-avresample
--enable-libtwolame --enable-libvo-aacenc
  libavutil      52. 38.100 / 52. 38.100
  libavcodec     55. 18.102 / 55. 18.102
  libavformat    55. 12.100 / 55. 12.100
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 79.101 /  3. 79.101
  libavresample   1.  1.  0 /  1.  1.  0
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
Guessed Channel Layout for  Input Stream #0.0 : stereo
Input #0, alsa, from 'default':
  Duration: N/A, start: 1377089711.958044, bitrate: 1536 kb/s
    Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[x11grab @ 0x104e2a0] device: :0.0 -> display: :0.0 x: 0 y: 0 width:
1366 height: 768
[x11grab @ 0x104e2a0] shared memory extension found
Input #1, x11grab, from ':0.0':
  Duration: N/A, start: 1377089712.038361, bitrate: 1007124 kb/s
    Stream #1:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1366x768,
1007124 kb/s, 30 tbr, 1000k tbn, 30 tbc
No pixel format specified, yuv444p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x106b700] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 0x106b700] profile High 4:4:4 Predictive, level 3.2, 4:4:4 8-bit
[libx264 @ 0x106b700] 264 - core 135 - H.264/MPEG-4 AVC codec - Copyleft
2003-2013 - 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=6
lookahead_threads=1 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, matroska, to 'test.mkv':
  Metadata:
    encoder         : Lavf55.12.100
    Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv444p,
1366x768, q=-1--1, 1k tbn, 30 tbc
    Stream #0:1: Audio: vorbis (libvorbis) (oV[0][0] / 0x566F), 48000
Hz, stereo, fltp
Stream mapping:
  Stream #1:0 -> #0:0 (rawvideo -> libx264)
  Stream #0:0 -> #0:1 (pcm_s16le -> libvorbis)
Press [q] to stop, [?] for help
[swscaler @ 0x102cac0] Warning: data is not aligned! This can lead to a
speedloss
Queue input is backward in time=     269kB time=00:00:01.60
bitrate=1377.7kbits/s   
[libvorbis @ 0x106f800] Queue input is backward in
time                                                                 
    Last message repeated 24 times
Queue input is backward in time=    1548kB time=00:00:38.54 bitrate=
329.0kbits/s   
[libvorbis @ 0x106f800] Queue input is backward in
time                                                                 
    Last message repeated 55 times
[matroska @ 0x106bd80] Non-monotonous DTS in output stream 0:1;
previous: 38626, current: 38612; changing to 38626. This may result in
incorrect timestamps in the output
file.                                                                  
[libvorbis @ 0x106f800] Queue input is backward in
time                                                                 
    Last message repeated 15 times
[matroska @ 0x106bd80] Non-monotonous DTS in output stream 0:1;
previous: 38626, current: 38582; changing to 38626. This may result in
incorrect timestamps in the output file.
[libvorbis @ 0x106f800] Queue input is backward in time
    Last message repeated 10 times
[matroska @ 0x106bd80] Non-monotonous DTS in output stream 0:1;
previous: 38626, current: 38561; changing to 38626. This may result in
incorrect timestamps in the output file.
[matroska @ 0x106bd80] Non-monotonous DTS in output stream 0:1;
previous: 38626, current: 38547; changing to 38626. This may result in
incorrect timestamps in the output file.
[matroska @ 0x106bd80] Non-monotonous DTS in output stream 0:1;
previous: 38626, current: 38539; changing to 38626. This may result in
incorrect timestamps in the output file.
[matroska @ 0x106bd80] Non-monotonous DTS in output stream 0:1;
previous: 38626, current: 38539; changing to 38626. This may result in
incorrect timestamps in the output file.
[matroska @ 0x106bd80] Non-monotonous DTS in output stream 0:1;
previous: 38626, current: 38544; changing to 38626. This may result in
incorrect timestamps in the output file.
[matroska @ 0x106bd80] Non-monotonous DTS in output stream 0:1;
previous: 38626, current: 38553; changing to 38626. This may result in
incorrect timestamps in the output file.
[matroska @ 0x106bd80] Non-monotonous DTS in output stream 0:1;
previous: 38626, current: 38567; changing to 38626. This may result in
incorrect timestamps in the output file.
[matroska @ 0x106bd80] Non-monotonous DTS in output stream 0:1;
previous: 38626, current: 38584; changing to 38626. This may result in
incorrect timestamps in the output file.
[matroska @ 0x106bd80] Non-monotonous DTS in output stream 0:1;
previous: 38626, current: 38603; changing to 38626. This may result in
incorrect timestamps in the output file.
frame= 1629 fps= 29 q=-1.0 Lsize=    2082kB time=00:00:54.69 bitrate=
311.8kbits/s   
video:1602kB audio:443kB subtitle:0 global headers:4kB muxing overhead
1.607300%
[libx264 @ 0x106b700] frame I:9     Avg QP:17.30  size:125414
[libx264 @ 0x106b700] frame P:427   Avg QP:20.45  size:   940
[libx264 @ 0x106b700] frame B:1193  Avg QP:32.43  size:    92
[libx264 @ 0x106b700] consecutive B-frames:  2.2%  0.4%  0.2% 97.2%
[libx264 @ 0x106b700] mb I  I16..4: 26.9% 35.6% 37.5%
[libx264 @ 0x106b700] mb P  I16..4:  0.5%  0.4%  0.2%  P16..4:  0.7% 
0.1%  0.1%  0.0%  0.0%    skip:97.9%
[libx264 @ 0x106b700] mb B  I16..4:  0.0%  0.1%  0.0%  B16..8:  0.7% 
0.0%  0.0%  direct: 0.0%  skip:99.2%  L0:52.6% L1:46.8% BI: 0.6%
[libx264 @ 0x106b700] 8x8 transform intra:37.9% inter:45.6%
[libx264 @ 0x106b700] coded y,u,v intra: 22.7% 4.6% 5.0% inter: 0.1%
0.0% 0.0%
[libx264 @ 0x106b700] i16 v,h,dc,p: 48% 51%  1%  1%
[libx264 @ 0x106b700] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 34% 27% 37%  0% 
0%  0%  0%  0%  0%
[libx264 @ 0x106b700] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 37% 29% 13%  3% 
3%  3%  5%  3%  4%
[libx264 @ 0x106b700] Weighted P-Frames: Y:0.5% UV:0.5%
[libx264 @ 0x106b700] ref P L0: 62.7% 12.7% 17.8%  6.7%  0.1%
[libx264 @ 0x106b700] ref B L0: 53.9% 44.1%  2.0%
[libx264 @ 0x106b700] ref B L1: 94.2%  5.8%
[libx264 @ 0x106b700] kb/s:241.66
artur at laptop:~/Wideo>


-- 

===========
Pozdrawiam
Artur Łącki
===========



More information about the ffmpeg-user mailing list