[Libav-user] Crash while running muxer.c example with a minimal configured version of ffmpeg

Nuno Santos nuno.santos at imaginando.pt
Thu Jun 24 19:14:03 EEST 2021


Hi,

I’m learning how to do muxing with ffmpeg. I’m looking at the muxer.c example.

I’ve compiled ffmpeg with a minimal set of dependencies:

./configure --extra-cflags="-mmacosx-version-min=10.12" --disable-all --disable-programs --enable-gpl --enable-small --enable-avcodec --enable-swscale --enable-swresample --enable-avformat --enable-muxer=h264,mp4 --enable-demuxer=h264,mp4 --enable-encoder=libx264,aac --enable-decoder=h264,aac --enable-encoder=h264_videotoolbox --enable-parser=h264 --enable-libx264 --enable-hwaccel=h264_videotoolbox --enable-videotoolbox --enable-protocol=file --extra-cflags="-I/usr/local/include/" --extra-cxxflags="-I/usr/local/include/" --extra-ldflags="-L/usr/local/lib/“

make
make examples

It is important to refer that I’ve ffmpeg installed via brew in my Mac system

Muxing example works out of the box.

However, when I copy the libs created during the compile process to a new folder and try to compile only the muxer.c example:

gcc -Wall -g -o main main.c -L./ -lavformat -lavcodec -lavutil -lx264 -lswscale -lswresample -framework CoreVideo -framework CoreMedia -framework AVFoundation -framework VideoToolbox -framework AppKit -liconv -lz

The compilations goes fine but it crashes while running:

codec_par.c:35:

memset(par, 0, sizeof(*par));           par:0x8000000000000000000


1 _platform_bzero$VARIANT$Haswell                                                (x86_64) /usr/lib/system/libsystem_platform.dylib     0x7fff205ad4d5 
2 codec_parameters_reset                                                         codec_par.c                                       35  0x100213ee2    
3 avcodec_parameters_from_context                                                codec_par.c                                       93  0x100213fab    
4 open_video(AVFormatContext *, AVCodec const *, OutputStream *, AVDictionary *) main.cpp                                          478 0x10000dc9a    
5 main                                                                           main.cpp                                          627 0x10000d30d    
6 start                                                                          (x86_64) /usr/lib/system/libdyld.dylib                0x7fff20585f5d 

My guess is that the version of ffmpeg that I’ve compiled is not being used by the examples. Instead, the example is using the system installed ffmpeg which has something that I haven’t included in the config. 

Why? Because if I take the “-L./“ parameter from the compilation command, it will use the systems libs and this time, it won’t crash.

I’ve been tinkering around for hours and I don’t find any other explanation.

Does anyone has guess of what could be happening or missing in my configuration?

Thanks!

Regards,

Nuno
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20210624/464fbe57/attachment.htm>


More information about the Libav-user mailing list