Opened 4 years ago

Closed 4 years ago

#4763 closed defect (fixed)

ffmpeg crash with "-movflags frag_keyframe+faststart"

Reported by: Abu Abdullah Owned by:
Priority: important Component: avformat
Version: git-master Keywords: mov crash regression SIGSEGV
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug: ffmpeg crash after creating m4a file but with mp3 extension using "-f mp4". the reason to have mp3 filename for m4a codec is to avoid an issue with android player seek function.

How to reproduce:

% ffmpeg-libfdk -i 001.rm -map_metadata -1 -c:a libfdk_aac -vbr 1 -movflags frag_keyframe+faststart -af aresample=async=1000 -f mp4 001.mp3

ffmpeg version N-69530-g52f2adc-Sherpya Copyright (c) 2000-2015 the FFmpeg devel
opers
  built with gcc 4.9.2 (GCC)
Input #0, rm, from '001.rm':
  Metadata:
    title           : ╟ط╘╤و╪ ╟ط├µط
    author          : ╟ط╘و╬ ع═ع╧ غ╟╒╤ ╟ط╧وغ ╟ط├ط╚╟غو
    copyright       : www.islamway.com
    comment         : ╟ط╟═╧╟╦ ▌و ╟ط╧وغ µ╟ط╚╧┌╔ - µ╟ط╙غ╔ µ╟╩╚╟┌ ╙غ╔ ╟ط╤╙µط µف╧ه ╟
ط╙ط▌ ة ═▀ع ط╚╙ ╟ط╬ع╟╤ ▌و ╟طµ▐╩ ╟ط═╟طو ة µ═▀ع ╩█╪و╔ ╟طµ╠ف µ╟ط▀▌وغ ة ═▀ع ط╚╙ ╟ط┼و╘
╤╚ ة ط╚╙ ╟ط▀┌╚ ╟ط┌╟طو ة فط و╠µ╥ ╙╚ ╟ط▀╟▌╤ ة ╘╤═ ط╟ وع╙ف ┼ط╟ ╟طع╪ف╤µغ ة µ═▀ع ╟╬╨
╟طع╒═▌ ط╚ط╟╧ ╟ط▀▌╤ ة ═▀ع غ╩▌ ╟ط═╟╠╚و
  Duration: 01:02:27.01, start: 0.000000, bitrate: 16 kb/s
    Stream #0:0: Audio: sipr (sipr / 0x72706973), 16000 Hz, mono, flt, 16 kb/s
[libfdk_aac @ 03561aa0] Note, the VBR setting is unsupported and only works with
 some parameter combinations
Output #0, mp4, to '001.mp3':
  Metadata:
    encoder         : Lavf56.19.100
    Stream #0:0: Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 16000 Hz, mon
o, s16
    Metadata:
      encoder         : Lavc56.21.102 libfdk_aac
Stream mapping:
  Stream #0:0 -> #0:0 (sipr (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
001.rm: Input/output error:44.82 bitrate=   0.0kbits/s
[mp4 @ 0355f160] Starting second pass: inserting sidx atoms

File is:
http://www.maknoon.com/audios.mp3/alalbani/alnoor/001.rm

Change History (6)

comment:1 Changed 4 years ago by Abu Abdullah

the file is created successfully and it works. ffmpeg is crashed (Windows reports that not through command line) after that.

comment:2 Changed 4 years ago by cehoyos

  • Keywords crash added
  • Priority changed from normal to important

Is the issue reproducible with the following command line tested with current FFmpeg git head (the version you are testing is old)?

$ ffmpeg -i 001.rm -acodec aac -strict -2 out.mp4

If not, please provide a backtrace for your crash as explained on http://ffmpeg.org/bugreports.html and please explain where your FFmpeg binary comes from.

comment:3 Changed 4 years ago by Abu Abdullah

the issue is not reproducible with, it is working fine with:
$ ffmpeg -i 001.rm -acodec aac -strict -2 out.mp4

i moved to linux for the debug:

(gdb) r -i 001.rm -c:a aac -strict -2 -movflags frag_keyframe+faststart -f mp4 001.mp3
Starting program: /home/oracle/ffmpeg_source/ffmpeg/ffmpeg_g -i 001.rm -c:a aac -strict -2 -movflags frag_keyframe+faststart -f mp4 001.mp3
Missing separate debuginfos, use: dnf debuginfo-install glibc-2.21-7.fc22.x86_64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
ffmpeg version git-2015-08-07-ecc806a Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 5.1.1 (GCC) 20150618 (Red Hat 5.1.1-4)
  configuration: --disable-yasm
  libavutil      54. 30.100 / 54. 30.100
  libavcodec     56. 57.100 / 56. 57.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 32.100 /  5. 32.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
Input #0, rm, from '001.rm':
  Metadata:
    title           : ������ �����
    author          : ����� ���� ���� ����� ��������
    copyright       : www.islamway.com
    comment         : ������� �� ����� ������� - ������ ������ ��� ������ ���� ����� � ��� ��� ������ �� ����� ������ � ���� ����� ����� ������� � ��� ��� ������� � ��� ����� ������ � �� ���� �� ������ � ��� �� ���� ��� �������� � ���� ��� ������ ����� ����� � ��� ��� �������
  Duration: 01:02:27.01, start: 0.000000, bitrate: 16 kb/s
    Stream #0:0: Audio: sipr (sipr / 0x72706973), 16000 Hz, mono, flt, 16 kb/s
[aac @ 0x19abf20] Too many bits per frame requested, clamping to max
Output #0, mp4, to '001.mp3':
  Metadata:
    title           : ������ �����
    author          : ����� ���� ���� ����� ��������
    copyright       : www.islamway.com
    comment         : ������� �� ����� ������� - ������ ������ ��� ������ ���� ����� � ��� ��� ������ �� ����� ������ � ���� ����� ����� ������� � ��� ��� ������� � ��� ����� ������ � �� ���� �� ������ � ��� �� ���� ��� �������� � ���� ��� ������ ����� ����� � ��� ��� �������
    encoder         : Lavf56.40.101
    Stream #0:0: Audio: aac ([64][0][0][0] / 0x0040), 16000 Hz, mono, fltp, 96 kb/s
    Metadata:
      encoder         : Lavc56.57.100 aac
Stream mapping:
  Stream #0:0 -> #0:0 (sipr (native) -> aac (native))
Press [q] to stop, [?] for help
001.rm: Input/output error:16.97 bitrate=   0.0kbits/s    
[mp4 @ 0x19a9300] Starting second pass: inserting sidx atoms

Program received signal SIGSEGV, Segmentation fault.
0x00000000005917c5 in mov_write_sidx_tag (total_sidx_size=0, ref_size=0, 
    track=<optimized out>, pb=0x19af240) at libavformat/movenc.c:3683
3683	        presentation_time = track->frag_info[0].time;
(gdb) quit
A debugging session is active.

	Inferior 1 [process 11840] will be killed.

i beleive the issue with +faststart option, if i remove it, it will start to work fine.

comment:4 Changed 4 years ago by cehoyos

  • Component changed from undetermined to avformat
  • Keywords mov regression SIGSEGV added
  • Reproduced by developer set
  • Status changed from new to open
  • Version changed from unspecified to git-master

Regression since 4dc305d784ea01efd30871e9aa6625eff66e9e87 / 40ed1cbf147d09fc0894bee160f0b6b6d9159fc5
Reproducible for example with:

$ ffmpeg -f s16be -i /dev/zero -acodec copy -movflags frag_keyframe+faststart -t 1 out.mov

Thank you for the report and the debugging!

comment:5 Changed 4 years ago by cehoyos

  • Summary changed from ffmpeg crash with "-f mp4" to ffmpeg crash with "-movflags frag_keyframe+faststart"

comment:6 Changed 4 years ago by heleppkes

  • Resolution set to fixed
  • Status changed from open to closed
Note: See TracTickets for help on using tickets.