[FFmpeg-devel] pulse audio has terrible timing.

Christ-Jan Wijtmans cj.wijtmans at gmail.com
Fri Feb 8 20:54:43 CET 2013


recording with pulse: frames stick at 24-26
recording with alsa: error, probably because pulse is running?
recording without sound: 30 fps sometimes jumps at 31-32


This is a real issue for me becuase i am trying to record minecraft
videos for youtube and i get jumpy frames.

$ ffmpeg -f pulse -ac 1 -ar 44100 -i default -f x11grab -s 1280x720 -i
:0.0+320,180 -vcodec huffyuv -acodec pcm_s16le output.mkv
ffmpeg version 0.10.6 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jan 31 2013 22:44:18 with gcc 4.6.3
  configuration: --prefix=/usr --libdir=/usr/lib64
--shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared
--cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++
--ar=x86_64-pc-linux-gnu-ar --optflags='-march=native -O2 -pipe'
--extra-cflags='-march=native -O2 -pipe'
--extra-cxxflags='-march=native -O2 -pipe' --disable-static
--enable-gpl --enable-version3 --enable-postproc --enable-avfilter
--disable-stripping --disable-debug --disable-doc --enable-openssl
--enable-nonfree --enable-gnutls --enable-libmp3lame
--enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libtheora
--enable-libvorbis --enable-libx264 --enable-libxvid --enable-libfaac
--enable-nonfree --enable-openal --disable-indev=v4l
--disable-indev=oss --disable-indev=jack --enable-x11grab
--enable-libpulse --enable-libv4l2 --disable-outdev=oss
--enable-libfreetype --enable-libass --enable-pthreads
--enable-libopencore-amrwb --enable-libopencore-amrnb --enable-libgsm
--enable-libdirac --enable-libschroedinger --enable-libspeex
--enable-l  libavutil      51. 35.100 / 51. 35.100
  libavcodec     53. 61.100 / 53. 61.100
  libavformat    53. 32.100 / 53. 32.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 61.100 /  2. 61.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
  libpostproc    52.  0.100 / 52.  0.100
[pulse @ 0x1247bb0] Estimating duration from bitrate, this may be inaccurate
Input #0, pulse, from 'default':
  Duration: N/A, start: 0.639118, bitrate: N/A
    Stream #0:0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
[x11grab @ 0x1255c50] device: :0.0+320,180 -> display: :0.0 x: 320 y:
180 width: 1280 height: 720
[x11grab @ 0x1255c50] shared memory extension found
[x11grab @ 0x1255c50] Estimating duration from bitrate, this may be inaccurate
Input #1, x11grab, from ':0.0+320,180':
  Duration: N/A, start: 1360352933.250735, bitrate: 883852 kb/s
    Stream #1:0: Video: rawvideo (BGRA / 0x41524742), bgra, 1280x720,
883852 kb/s, 29.97 tbr, 1000k tbn, 29.97 tbc
File 'output.mkv' already exists. Overwrite ? [y/N] y
w:1280 h:720 pixfmt:bgra tb:1/1000000 sar:0/1 sws_param:
[huffyuv @ 0x1261ee0] using huffyuv 2.2.0 or newer interlacing flag
Output #0, matroska, to 'output.mkv':
  Metadata:
    encoder         : Lavf53.32.100
    Stream #0:0: Video: huffyuv (HFYU / 0x55594648), bgra, 1280x720,
q=2-31, 200 kb/s, 1k tbn, 29.97 tbc
    Stream #0:1: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
Stream mapping:
  Stream #1:0 -> #0:0 (rawvideo -> huffyuv)
  Stream #0:0 -> #0:1 (pcm_s16le -> pcm_s16le)
Press [q] to stop, [?] for help
frame=  179 fps= 24 q=0.0 Lsize=  298428kB time=00:00:11.08
bitrate=220483.7kbits/s dup=0 drop=51
video:297459kB audio:955kB global headers:0kB muxing overhead 0.004794%
Received signal 2: terminating.


$ ffmpeg -f alsa -ac 1 -ar 44100 -i default -f x11grab -s 1280x720 -i
:0.0+320,180 -vcodec huffyuv -acodec pcm_s16le output.mkv
ffmpeg version 0.10.6 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jan 31 2013 22:44:18 with gcc 4.6.3
  configuration: --prefix=/usr --libdir=/usr/lib64
--shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared
--cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++
--ar=x86_64-pc-linux-gnu-ar --optflags='-march=native -O2 -pipe'
--extra-cflags='-march=native -O2 -pipe'
--extra-cxxflags='-march=native -O2 -pipe' --disable-static
--enable-gpl --enable-version3 --enable-postproc --enable-avfilter
--disable-stripping --disable-debug --disable-doc --enable-openssl
--enable-nonfree --enable-gnutls --enable-libmp3lame
--enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libtheora
--enable-libvorbis --enable-libx264 --enable-libxvid --enable-libfaac
--enable-nonfree --enable-openal --disable-indev=v4l
--disable-indev=oss --disable-indev=jack --enable-x11grab
--enable-libpulse --enable-libv4l2 --disable-outdev=oss
--enable-libfreetype --enable-libass --enable-pthreads
--enable-libopencore-amrwb --enable-libopencore-amrnb --enable-libgsm
--enable-libdirac --enable-libschroedinger --enable-libspeex
--enable-l  libavutil      51. 35.100 / 51. 35.100
  libavcodec     53. 61.100 / 53. 61.100
  libavformat    53. 32.100 / 53. 32.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 61.100 /  2. 61.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
  libpostproc    52.  0.100 / 52.  0.100
[alsa @ 0x225ebb0] Estimating duration from bitrate, this may be inaccurate
Input #0, alsa, from 'default':
  Duration: N/A, start: 1360352963.071920, bitrate: N/A
    Stream #0:0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
[x11grab @ 0x225fd40] device: :0.0+320,180 -> display: :0.0 x: 320 y:
180 width: 1280 height: 720
[x11grab @ 0x225fd40] shared memory extension found
[x11grab @ 0x225fd40] Estimating duration from bitrate, this may be inaccurate
Input #1, x11grab, from ':0.0+320,180':
  Duration: N/A, start: 1360352963.107871, bitrate: 883852 kb/s
    Stream #1:0: Video: rawvideo (BGRA / 0x41524742), bgra, 1280x720,
883852 kb/s, 29.97 tbr, 1000k tbn, 29.97 tbc
File 'output.mkv' already exists. Overwrite ? [y/N] y
w:1280 h:720 pixfmt:bgra tb:1/1000000 sar:0/1 sws_param:
[huffyuv @ 0x228c910] using huffyuv 2.2.0 or newer interlacing flag
Output #0, matroska, to 'output.mkv':
  Metadata:
    encoder         : Lavf53.32.100
    Stream #0:0: Video: huffyuv (HFYU / 0x55594648), bgra, 1280x720,
q=2-31, 200 kb/s, 1k tbn, 29.97 tbc
    Stream #0:1: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
Stream mapping:
  Stream #1:0 -> #0:0 (rawvideo -> huffyuv)
  Stream #0:0 -> #0:1 (pcm_s16le -> pcm_s16le)
Press [q] to stop, [?] for help
[matroska @ 0x228c0a0] Application provided invalid, non monotonically
increasing dts to muxer in stream 1: 1618 >= 1618
av_interleaved_write_frame(): Invalid argument


$ ffmpeg -f x11grab -s 1280x720 -i :0.0+320,180 -vcodec huffyuv
-acodec pcm_s16le output.mkvffmpeg version 0.10.6 Copyright (c)
2000-2012 the FFmpeg developers
  built on Jan 31 2013 22:44:18 with gcc 4.6.3
  configuration: --prefix=/usr --libdir=/usr/lib64
--shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared
--cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++
--ar=x86_64-pc-linux-gnu-ar --optflags='-march=native -O2 -pipe'
--extra-cflags='-march=native -O2 -pipe'
--extra-cxxflags='-march=native -O2 -pipe' --disable-static
--enable-gpl --enable-version3 --enable-postproc --enable-avfilter
--disable-stripping --disable-debug --disable-doc --enable-openssl
--enable-nonfree --enable-gnutls --enable-libmp3lame
--enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libtheora
--enable-libvorbis --enable-libx264 --enable-libxvid --enable-libfaac
--enable-nonfree --enable-openal --disable-indev=v4l
--disable-indev=oss --disable-indev=jack --enable-x11grab
--enable-libpulse --enable-libv4l2 --disable-outdev=oss
--enable-libfreetype --enable-libass --enable-pthreads
--enable-libopencore-amrwb --enable-libopencore-amrnb --enable-libgsm
--enable-libdirac --enable-libschroedinger --enable-libspeex
--enable-l  libavutil      51. 35.100 / 51. 35.100
  libavcodec     53. 61.100 / 53. 61.100
  libavformat    53. 32.100 / 53. 32.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 61.100 /  2. 61.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
  libpostproc    52.  0.100 / 52.  0.100
[x11grab @ 0x16a7bb0] device: :0.0+320,180 -> display: :0.0 x: 320 y:
180 width: 1280 height: 720
[x11grab @ 0x16a7bb0] shared memory extension found
[x11grab @ 0x16a7bb0] Estimating duration from bitrate, this may be inaccurate
Input #0, x11grab, from ':0.0+320,180':
  Duration: N/A, start: 1360353163.830691, bitrate: 883852 kb/s
    Stream #0:0: Video: rawvideo (BGRA / 0x41524742), bgra, 1280x720,
883852 kb/s, 29.97 tbr, 1000k tbn, 29.97 tbc
File 'output.mkv' already exists. Overwrite ? [y/N] y
w:1280 h:720 pixfmt:bgra tb:1/1000000 sar:0/1 sws_param:
[huffyuv @ 0x16b9440] using huffyuv 2.2.0 or newer interlacing flag
Output #0, matroska, to 'output.mkv':
  Metadata:
    encoder         : Lavf53.32.100
    Stream #0:0: Video: huffyuv (HFYU / 0x55594648), bgra, 1280x720,
q=2-31, 200 kb/s, 1k tbn, 29.97 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo -> huffyuv)
Press [q] to stop, [?] for help
frame=  223 fps= 30 q=0.0 Lsize=  356406kB time=00:00:09.11
bitrate=320491.7kbits/s dup=0 drop=17
video:356397kB audio:0kB global headers:0kB muxing overhead 0.002657%
Received signal 2: terminating.


More information about the ffmpeg-devel mailing list