<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">I’m learning how to do muxing with ffmpeg. I’m looking at the muxer.c example.</div><div class=""><br class=""></div><div class="">I’ve compiled ffmpeg with a minimal set of dependencies:</div><div class=""><br class=""></div><div class=""><div class="">./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/“</div><div class=""><br class=""></div><div class="">make</div><div class="">make examples</div></div><div class=""><br class=""></div><div class="">It is important to refer that I’ve ffmpeg installed via brew in my Mac system</div><div class=""><br class=""></div><div class="">Muxing example works out of the box.</div><div class=""><br class=""></div><div class="">However, when I copy the libs created during the compile process to a new folder and try to compile only the muxer.c example:</div><div class=""><br class=""></div><div class="">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</div><div class=""><br class=""></div><div class="">The compilations goes fine but it crashes while running:</div><div class=""><br class=""></div><div class=""><div class="">codec_par.c:35:</div><div class=""><br class=""></div><div class="">
<pre style="margin-top: 0px; margin-bottom: 0px;" class=""><!--StartFragment-->memset(<span style=" font-style:italic;" class="">par</span>,<span style="color: rgb(79, 79, 79);" class=""> </span><span style="color: rgb(229, 16, 229);" class="">0</span>,<span style="color: rgb(79, 79, 79);" class=""> </span><span style="color: rgb(188, 188, 0);" class="">sizeof</span>(<span style="color: rgb(106, 106, 106);" class="">*</span>par));           par:0x8000000000000000000<!--EndFragment--></pre><div class=""><br class=""></div></div><div class=""><br class=""></div><div class="">1 _platform_bzero$VARIANT$Haswell                                                (x86_64) /usr/lib/system/libsystem_platform.dylib     0x7fff205ad4d5 </div><div class="">2 codec_parameters_reset                                                         codec_par.c                                       35  0x100213ee2    </div><div class="">3 avcodec_parameters_from_context                                                codec_par.c                                       93  0x100213fab    </div><div class="">4 open_video(AVFormatContext *, AVCodec const *, OutputStream *, AVDictionary *) main.cpp                                          478 0x10000dc9a    </div><div class="">5 main                                                                           main.cpp                                          627 0x10000d30d    </div><div class="">6 start                                                                          (x86_64) /usr/lib/system/libdyld.dylib                0x7fff20585f5d </div></div><div class=""><br class=""></div><div class="">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. </div><div class=""><br class=""></div><div class="">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.</div><div class=""><br class=""></div><div class="">I’ve been tinkering around for hours and I don’t find any other explanation.</div><div class=""><br class=""></div><div class="">Does anyone has guess of what could be happening or missing in my configuration?</div><div class=""><br class=""></div><div class="">Thanks!</div><div class=""><br class=""></div><div class="">Regards,</div><div class=""><br class=""></div><div class="">Nuno</div></body></html>