ffmpeg 2.1 segfaults or fails
ffmpeg shipped with Alpine 2.7 segfaults:
[ 18.222713] NET: Registered protocol family 10
[ 2407.890713] ffmpeg[1743]: segfault at 0 ip 0000664bfdb65c38 sp
000071311cb549c8 error 4 in
libuClibc-0.9.33.2.so[664bfdb29000+75000]
[ 2407.890731] grsec: From 10.44.3.153: Segmentation fault occurred at
(nil) in /usr/bin/ffmpeg[ffmpeg:1743] uid/euid:0/0 gid/egid:0/0,
parent /usr/local/bin/stream.sh[stream.sh:1742] uid/euid:0/0
gid/egid:0/0
[ 2407.890800] grsec: From 10.44.3.153: denied resource overstep by
requesting 4096 for RLIMIT_CORE against limit 0 for
/usr/bin/ffmpeg[ffmpeg:1743] uid/euid:0/0 gid/egid:0/0, parent
/usr/local/bin/stream.sh[stream.sh:1742] uid/euid:0/0 gid/egid:0/0
I observed this behaviour when the input codec is h264 from a wowza streaming server.
This is the strace:
——8<————8<————8<————8<————8<————8<————8<————8<——
Input #0, rtsp, from
‘rtsp://192.168.10.10:1935/live-special/test.stream’:
Metadata:
title : EventoSpeciale-special.stream
Duration: N/A, start: 0.128000, bitrate: N/A
Stream #0:0: Audio: aac, 16000 Hz, mono, fltp
Stream #0:1: Video: h264 (Main), yuvj420p(pc, bt470bg), 352x288 [SAR
12:11 DAR 4:3], 25 tbr, 90k tbn, 180k tbc
rtmp server requested close
authenticating publisher
rtmp server requested close
authenticating publisher
[swscaler @ 0xd147a468740] deprecated pixel format used, make sure you
did set range correctly
No pixel format specified, yuvj420p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0xd147a5c89a0] using SAR=1/1
[{WIFSIGNALED(s) && WTERMSIG (s) == SIGSEGV}], 0, NULL) = 1931
—- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=1931,
si_status=SIGSEGV, si_utime=3, si_stime=1} —-
write(2, “Segmentation fault\n”, 19Segmentation fault
) = 19
read(10, “”, 1023) = 0
exit_group(139) = ?
+ exited with 139 +
——8<————8<————8<————8<————8<————8<————8<————8<——
Kernel version: Linux encoder03 3.10.19-0-grsec #1-Alpine SMP Wed Nov 13 10:46:56 UTC 2013 x86_64 Linux
Relevant packages:
ffmpeg-libs-2.1-r0
ffmpeg-2.1-r0
x264-20130409-r1
With another encoder (Antrica ANT-32000), ffmpeg does not segfaults, but still fails with this error “Operation not permitted” (strace output):
——8<————8<————8<————8<————8<————8<————8<————8<——
rtsp @ 0x7bf0abbaba0] UDP timeout, retrying with TCP
[rtsp @ 0x7bf0abbaba0] method PAUSE failed: 501 Not Implemented
rtsp://192.168.10.11/video1+audio1: Operation not permitted
size= 0kB time=00:00:00.00 bitrate=N/A
video:0kB audio:0kB subtitle:0 global headers:0kB muxing overhead inf%
Output file is empty, nothing was encoded (check -ss / -t / -frames
parameters if used)
[{WIFEXITED(s) && WEXITSTATUS (s) == 0}], 0, NULL) = 1951
—- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=1951,
si_status=0, si_utime=2, si_stime=0} —-
read(10, “”, 1023) = 0
exit_group(0) = ?
+ exited with 0 +
——8<————8<————8<————8<————8<————8<————8<————8<——
With Alpine 2.6 and ffmpeg 2.0.2 it works flawlessly.
This is the command used in both cases:
——8<————8<————8<————8<————8<————8<————8<————8<——
Antrica ANT-32000 Encoder (Input HDMI, encodes in h264 with aac audio)
ffmpeg -i rtsp://$IPENC/video1+audio1 \
-vcodec libx264 -c:v libx264 -b:v ${RATEMQ} -minrate ${RATEMQ} -maxrate
${RATEMQ} -bufsize 150k \
-g $((5*20)) -preset superfast -filter:v scale=480:360 -acodec copy
\
-f flv “$ENTRYMQ VARSMQ playpath=
{PLAYPATHMQ}”
Wowza (encodes in h264 with aac audio):
ffmpeg -i rtsp://$IPENC/live-special/test.stream \
-vcodec libx264 -c:v libx264 -b:v ${RATEMQ} -minrate ${RATEMQ} -maxrate
${RATEMQ} -bufsize 150k \
-g $((5*20)) -preset superfast -filter:v scale=480:360 -acodec copy
\
-f flv “$ENTRYMQ VARSMQ playpath=
{PLAYPATHMQ}”
——8<————8<————8<————8<————8<————8<————8<————8<——
(from redmine: issue id 2485, created on 2013-12-11, closed on 2014-04-21)
- Changesets:
- Revision 5d6fa451 by Natanael Copa on 2014-03-07T11:36:03Z:
main/ffmpeg: upgrade to 2.1.4
I hope this fixes sefgaults
ref #2485
- Revision a4bde33c by Natanael Copa on 2014-04-17T13:19:13Z:
main/x264: disable aggresive loop optimizations
ref #2485
- Revision 644c2fc5 by Natanael Copa on 2014-04-17T13:24:28Z:
main/x264: disable aggresive loop optimizations
fixes #2485
(cherry picked from commit a4bde33c11ae0e960f722f6e6904eedd42f3c532)