transitive-bullshit / ffmpeg-gl-transition

FFmpeg filter for applying GLSL transitions between video streams.
650 stars 126 forks source link

Ffmpeg fails with "Segmentation fault (core dumped)" #23

Closed arjun-g closed 3 years ago

arjun-g commented 6 years ago

I followed your instruction and build the ffmpeg in my Ubuntu 16.04 server. I used "Linux with EGL" option. Everything went well and the build was successful.

Then I ran this command with the sample file you gave,

ffmpeg -loglevel debug -i media/0.mp4 -i media/1.mp4 -filter_complex gltransition -y out.mp4

It failed with "Segmentation fault (core dumped)" error and here is the debug log,

ffmpeg version N-91545-gd36b839 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
  configuration: --prefix=/home/calicomadmin/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/calicomadmin/ffmpeg_build/include --extra-ldflags=-L/home/calicomadmin/ffmpeg_build/lib --extra-libs='-lpthread -lm -lGLEW -lEGL' --bindir=/home/calicomadmin/bin --enable-cuda --enable-cuvid --enable-libnpp --extra-cflags=-I/usr/local/cuda/include/ --extra-ldflags=-L/usr/local/cuda/lib64/ --nvccflags='-gencode arch=compute_52,code=sm_52 -O2' --enable-gpl --enable-opengl --enable-libaom --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-filter=gltransition --enable-nonfree
  libavutil      56. 18.102 / 56. 18.102
  libavcodec     58. 22.100 / 58. 22.100
  libavformat    58. 17.101 / 58. 17.101
  libavdevice    58.  4.101 / 58.  4.101
  libavfilter     7. 26.100 /  7. 26.100
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-i' ... matched as input url with argument 'media/0.mp4'.
Reading option '-i' ... matched as input url with argument 'media/1.mp4'.
Reading option '-filter_complex' ... matched as option 'filter_complex' (create a complex filtergraph) with argument 'gltransition'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option 'out.mp4' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Applying option filter_complex (create a complex filtergraph) with argument gltransition.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url media/0.mp4.
Successfully parsed a group of options.
Opening an input file: media/0.mp4.
[NULL @ 0x3cb17c0] Opening 'media/0.mp4' for reading
[file @ 0x3cb20c0] Setting default whitelist 'file,crypto'
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cb17c0] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cb17c0] ISO: File Type Major Brand: isom
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cb17c0] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cb17c0] Processing st: 0, edit list 0 - media time: 0, duration: 51200
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cb17c0] Before avformat_find_stream_info() pos: 1234 bytes read:32768 seeks:0 nb_streams:1[h264 @ 0x3cb3280] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x3cb3280] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x3cb3280] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x3cb3280] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x3cb3280] Format yuv420p chosen by get_format().
[h264 @ 0x3cb3280] Reinit context to 640x368, pix_fmt: yuv420p
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cb17c0] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cb17c0] After avformat_find_stream_info() pos: 7467 bytes read:32768 seeks:0 frames:1
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'media/0.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:04.00, start: 0.000000, bitrate: 454 kb/s
    Stream #0:0(und), 1, 1/12800: Video: h264 (Constrained Baseline), 1 reference frame (avc1 / 0x31637661), yuv420p(left), 640x360 (640x368) [SAR 1:1 DAR 16:9], 0/1, 452 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Successfully opened the file.
Parsing a group of options: input url media/1.mp4.
Successfully parsed a group of options.
Opening an input file: media/1.mp4.
[NULL @ 0x3cdb500] Opening 'media/1.mp4' for reading
[file @ 0x3cb9bc0] Setting default whitelist 'file,crypto'
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cdb500] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cdb500] ISO: File Type Major Brand: isom
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cdb500] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cdb500] Processing st: 0, edit list 0 - media time: 0, duration: 51200
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cdb500] Before avformat_find_stream_info() pos: 1217 bytes read:32768 seeks:0 nb_streams:1[h264 @ 0x3cdc800] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x3cdc800] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x3cdc800] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x3cdc800] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x3cdc800] Format yuv420p chosen by get_format().
[h264 @ 0x3cdc800] Reinit context to 640x368, pix_fmt: yuv420p
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cdb500] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cdb500] After avformat_find_stream_info() pos: 16010 bytes read:32768 seeks:0 frames:1
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'media/1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:04.00, start: 0.000000, bitrate: 530 kb/s
    Stream #1:0(eng), 1, 1/12800: Video: h264 (Constrained Baseline), 1 reference frame (avc1 / 0x31637661), yuv420p(left), 640x360 (640x368), 0/1, 528 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Successfully opened the file.
Parsing a group of options: output url out.mp4.
Successfully parsed a group of options.
Opening an output file: out.mp4.
[file @ 0x3cd2b40] Setting default whitelist 'file,crypto'
Successfully opened the file.
detected 6 logical cores
[h264 @ 0x3cd11c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x3cd11c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x3e16f80] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x3e16f80] nal_unit_type: 8(PPS), nal_ref_idc: 3
Stream mapping:
  Stream #0:0 (h264) -> gltransition:from
  Stream #1:0 (h264) -> gltransition:to
  gltransition -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    Last message repeated 1 times
[h264 @ 0x3cd11c0] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x3cd11c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x3cd11c0] Format yuv420p chosen by get_format().
[h264 @ 0x3cd11c0] Reinit context to 640x368, pix_fmt: yuv420p
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[h264 @ 0x3cd8a00] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[h264 @ 0x3d19680] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[h264 @ 0x3da3e80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[h264 @ 0x3dc02c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[h264 @ 0x3ddca00] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    Last message repeated 1 times
[h264 @ 0x3df9200] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x3e16f80] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x3e16f80] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x3e16f80] Format yuv420p chosen by get_format().
[h264 @ 0x3e16f80] Reinit context to 640x368, pix_fmt: yuv420p
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[h264 @ 0x3e29100] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[h264 @ 0x3e6f240] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[h264 @ 0x3e8b8c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[h264 @ 0x3ea8040] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[h264 @ 0x3ec4780] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x3ee0f00] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[graph 0 input from stream 0:0 @ 0x4030c40] Setting 'video_size' to value '640x360'
[graph 0 input from stream 0:0 @ 0x4030c40] Setting 'pix_fmt' to value '0'
[graph 0 input from stream 0:0 @ 0x4030c40] Setting 'time_base' to value '1/12800'
[graph 0 input from stream 0:0 @ 0x4030c40] Setting 'pixel_aspect' to value '1/1'
[graph 0 input from stream 0:0 @ 0x4030c40] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 0x4030c40] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 0x4030c40] w:640 h:360 pixfmt:yuv420p tb:1/12800 fr:25/1 sar:1/1 sws_param:flags=2
[graph 0 input from stream 1:0 @ 0x402ef40] Setting 'video_size' to value '640x360'
[graph 0 input from stream 1:0 @ 0x402ef40] Setting 'pix_fmt' to value '0'
[graph 0 input from stream 1:0 @ 0x402ef40] Setting 'time_base' to value '1/12800'
[graph 0 input from stream 1:0 @ 0x402ef40] Setting 'pixel_aspect' to value '0/1'
[graph 0 input from stream 1:0 @ 0x402ef40] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 1:0 @ 0x402ef40] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 1:0 @ 0x402ef40] w:640 h:360 pixfmt:yuv420p tb:1/12800 fr:25/1 sar:0/1 sws_param:flags=2
[format @ 0x402f4c0] Setting 'pix_fmts' to value 'yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p|nv12|nv16|nv21'
[auto_scaler_0 @ 0x40318c0] w:iw h:ih flags:'bilinear' interl:0
[Parsed_gltransition_0 @ 0x4030380] auto-inserting filter 'auto_scaler_0' between the filter 'graph 0 input from stream 0:0' and the filter 'Parsed_gltransition_0'
[auto_scaler_1 @ 0x4031dc0] w:iw h:ih flags:'bilinear' interl:0
[Parsed_gltransition_0 @ 0x4030380] auto-inserting filter 'auto_scaler_1' between the filter 'graph 0 input from stream 1:0' and the filter 'Parsed_gltransition_0'
[auto_scaler_2 @ 0x40316c0] w:iw h:ih flags:'bilinear' interl:0
[format @ 0x402f4c0] auto-inserting filter 'auto_scaler_2' between the filter 'Parsed_gltransition_0' and the filter 'format'
[AVFilterGraph @ 0x402f3c0] query_formats: 5 queried, 1 merged, 3 already done, 0 delayed
[auto_scaler_2 @ 0x40316c0] picking yuv444p out of 8 ref:rgb24 alpha:0
[auto_scaler_0 @ 0x40318c0] w:640 h:360 fmt:yuv420p sar:1/1 -> w:640 h:360 fmt:rgb24 sar:1/1 flags:0x2
[Parsed_gltransition_0 @ 0x4030380] 673005440Segmentation fault (core dumped)
eduardsin commented 6 years ago

Same here, tried to debug a little bit. I found that glewInit returns error of 'Missing GL version'. As I understand from https://stackoverflow.com/questions/47415198/missing-gl-version-from-glewinit-using-egl it seems like nvidia-driver error. Didn't find anyway around it yet.

delort commented 5 years ago

Same issue o on ubuntu 18.04 server...

mylyu commented 5 years ago

I failed similarly.

aomv commented 5 years ago

Same

SprrowZ commented 5 years ago

Had you solved?

mylyu commented 5 years ago

no

On Fri, Aug 30, 2019, 2:14 PM SprrowZ notifications@github.com wrote:

Had you solved?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/transitive-bullshit/ffmpeg-gl-transition/issues/23?email_source=notifications&email_token=ACN3SSQMV2KREWBDL77EJGDQHC3EFA5CNFSM4FNTXOMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5QVJPI#issuecomment-526472381, or mute the thread https://github.com/notifications/unsubscribe-auth/ACN3SSXMSN6UW3EEFYURQPTQHC3EFANCNFSM4FNTXOMA .

mylyu commented 5 years ago

I finally by-passed this problem using docker https://github.com/transitive-bullshit/ffmpeg-gl-transition/pull/42/commits/21ea194c2c530417c5055059cea44da5d2647b52

javeedrahman commented 4 years ago

Hi, I am getting the same issues on installing in Centos 7 using "Linux with EGL" @eduardsin @transitive-bullshit

bhuebschen commented 4 years ago

same on debian 10 using "Linux with EGL" ... running ffmpeg with xvfb-run works, but produces just black videos

maciek01 commented 4 years ago

same on raspbian stretch on RPI0W

transitive-bullshit commented 3 years ago

should be solved by https://github.com/transitive-bullshit/ffmpeg-gl-transition/pull/57