ffmpeg segfaults over certain resolution

0

I'm trying to use ffmpeg to record my whole screen (1366x768), but if I set the video size above a certain size, I get a segfault. As can be seen in the output, I compiled from source less than 1 hour before posting this question.

1366x744 (works perfectly well)

λ ./ffmpeg -f x11grab -r 25 -s 1366x744 -i :0.0+0,24 -vcodec libx264  -threads 0 screen.mkv
ffmpeg version 2.5.1 Copyright (c) 2000-2014 the FFmpeg developers
  built on Dec 18 2014 20:32:54 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libxvid --enable-x11grab --enable-libvorbis
  libavutil      54. 15.100 / 54. 15.100
  libavcodec     56. 13.100 / 56. 13.100
  libavformat    56. 15.102 / 56. 15.102
  libavdevice    56.  3.100 / 56.  3.100
  libavfilter     5.  2.103 /  5.  2.103
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
[x11grab @ 0x1ab6f20] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, x11grab, from ':0.0+0,24':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: rawvideo (BGRA / 0x41524742), bgra, 1366x744, 25 fps, 25 tbr, 1000k tbn, 25 tbc
File 'screen.mkv' already exists. Overwrite ? [y/N] n
Not overwriting - exiting

1366x745 (segfault)

λ ./ffmpeg -f x11grab -r 25 -s 1366x745 -i :0.0+0,24 -vcodec libx264  -threads 0 screen.mkv
ffmpeg version 2.5.1 Copyright (c) 2000-2014 the FFmpeg developers
  built on Dec 18 2014 20:32:54 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libxvid --enable-x11grab --enable-libvorbis
  libavutil      54. 15.100 / 54. 15.100
  libavcodec     56. 13.100 / 56. 13.100
  libavformat    56. 15.102 / 56. 15.102
  libavdevice    56.  3.100 / 56.  3.100
  libavfilter     5.  2.103 /  5.  2.103
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
[1]    31332 segmentation fault (core dumped)  ./ffmpeg -f x11grab -r 25 -s 1366x745 -i :0.0+0,24 -vcodec libx264 -threads 0

Is there something I'm missing here?

Nate Mara

Posted 2014-12-19T01:51:33.167

Reputation: 270

What's the output of xwininfo -root | awk '/-geo/{print $2}'? – llogan – 2014-12-19T02:03:09.847

@LordNeckbeard 1366x768+0+0 – Nate Mara – 2014-12-19T02:04:30.760

Answers

1

Your y-offset is set to 24. Adding this value to your input video size results in a value that is larger than your screen size (745 + 24 = 769).

A segmentation fault seems odd because I believe ffmpeg should provide an unintuitive error message. Something like:

X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  142 (MIT-SHM)
  Minor opcode of failed request:  4 (X_ShmGetImage)
  Serial number of failed request:  11
  Current serial number in output stream:  11

llogan

Posted 2014-12-19T01:51:33.167

Reputation: 31 929