[FFmpeg-trac] #615(undetermined:closed): ALSA buffer xrun

FFmpeg trac at avcodec.org
Mon May 20 15:47:30 CEST 2013


#615: ALSA buffer xrun
-------------------------------------+-------------------------------------
             Reporter:  burek        |                    Owner:  michael
                 Type:  defect       |                   Status:  closed
             Priority:  normal       |                Component:
              Version:  git-master   |  undetermined
             Keywords:               |               Resolution:
             Blocking:               |  needs_more_info
Analyzed by developer:  0            |               Blocked By:
                                     |  Reproduced by developer:  0
-------------------------------------+-------------------------------------

Comment (by unknow):

 i encounter the same problem.

 it apear only when i record from alsa & x11grab

 increasing ALSA_BUFFER_SIZE_MAX didn't seem to change anything

 {{{
 $ ffmpeg  -f x11grab -r 25 -s 1152x864 -i 0:0+1,20 -f alsa -i default
 -acodec libfaac -vcodec libx264 -preset ultrafast -y rec.mkv
 }}}
 or
 {{{
 $ ffmpeg  -f x11grab -r 25 -s 1152x864 -i 0:0+1,20 -f alsa -i default
 -acodec libfaac -vcodec libx264 -preset ultrafast -f null -y /dev/null
 }}}
 with 65535 or 6553500 i got xrun every ~30sec


 the fun thing is changing audio option don't change anything but:
 {{{
 $ ffmpeg -f alsa -i default -f x11grab -r 10 -s 320x240  -i :0.0+1,20
 -acodec libfaac -vcodec libx264 -preset ultrafast rec.mkv
 }}}
 works with a lot of
 {{{
 [libfaac @ 0xdf2a00] Queue input is backward in time
 [matroska @ 0xdf1160] Non-monotonous DTS in output stream 0:1; previous:
 281, current: 276; changing to 281. This may result in incorrect
 timestamps in the output file.
 }}}
 but 0 xrun, sound and video is in sync

 so
 Replying to [comment:13 reimar]:
 > Did you try capturing audio and video at the same time bug from
 different FFmpeg processes?
 > I would have guessed that due to the overhead of video processing FFmpeg
 might not get data often enough from the audio device.
 > Even if that is not the case, clocks and thus timestamps for audio and
 video running apart might cause FFmpeg to read audio data not often
 enough.
 > For both cases creating a separate thread that can buffer far more data
 than ALSA on its own (similar to what is done in libavformat/udp.c) should
 help.
 should be right

 launching separatly
 {{{
 $ ffmpeg -f alsa -i default -acodec libfaac rec_va.mkv
 $ ffmpeg  -f x11grab -r 25 -s 1152x864 -i 0:0+1,20 -vcodec libx264 -preset
 ultrafast rec_vo.mkv
 }}}
 got no xrun

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/615#comment:20>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list