compiling ffmpeg on linux for Windows debugging

Examples and samples for those who develop software with FFmpeg.
Post Reply
bsenftner
Posts: 11
Joined: Thu Dec 15, 2016 9:01 pm

compiling ffmpeg on linux for Windows debugging

Post by bsenftner » Tue Jan 17, 2017 6:32 pm

Since Linux centric pages don't seem to include this type of information, here is how to build linux versions of ffmpeg with ffplay in a step-wise debuggable form. For Windows developers working on media playback, step-wise following how ffplay, ffserver, and ffprobe work is often not possible on Windows, and the lack of other documentation makes this step-wise following the logic the only documentation for using these libraries. Note that the step-wise debugging is on Linux, not Windows. If anyone knows how to build a steppable Windows version, that'd be great if you added the info below.

This being informal, it is not a comprehensive guide. This describes an ubuntu 14.04 instance, operating as a virtualbox VM on a Win10 host. FWIW, visual studio is open on the Win10 side, and I'm debugging a media player's edge cases by stepping on ubuntu how ffplay successfully handles them while my own libav based code, following everything I think it should, fails.

First the instructions are a variation from these: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
Those should work without variation. If they don't, your linux install has issues. Those instructions do not generate ffplay, and are not debuggable. Here's the differences from those instructions to give you ffplay in addition to ffmpeg, ffprobe, and ffserver - with all being step-wise debuggable versions:

In this first step: https://trac.ffmpeg.org/wiki/Compilatio ... pendencies
Add libsdl2-dev to the list of dependant libraries. (Or change libsdl1.2-dev, I happened to want both sdl versions)

In the instructions to build ffmpeg: https://trac.ffmpeg.org/wiki/Compilatio ... ntu#ffmpeg
Use this in place of what they provide for the same line: (sorry, but I don't know what this construct is called)

Code: Select all

PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
  --prefix="$HOME/ffmpeg_build" \
  --pkg-config-flags="--static" \
  --extra-cflags="-I$HOME/ffmpeg_build/include -O0 -fno-inline" \
  --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
  --bindir="$HOME/bin" \
  --enable-gpl \
  --disable-optimizations \
  --disable-mmx \
  --disable-stripping \
  --enable-version3 \
  --enable-ffplay \
  --enable-libass \
  --enable-libfdk-aac \
  --enable-debug=3 \
  --enable-libfreetype \
  --enable-libmp3lame \
  --enable-libopus \
  --enable-libtheora \
  --enable-libvorbis \
  --enable-libvpx \
  --enable-libx264 \
  --enable-libx265 \
  --enable-nonfree
After the remaining 4 commands back in https://trac.ffmpeg.org/wiki/Compilatio ... ntu#ffmpeg the debuggable versions are generated.

After that, these are probably useful for those of use too used to visual studio:
http://www.unknownroad.com/rtfm/gdbtut/gdbtoc.html
http://www.yolinux.com/TUTORIALS/GDB-Commands.html

Post Reply