CONTENTS

Home
Updates
Software
Electronics
Android / iOS
Videos
Music
Resume
Contact



HTTPS VERSION


FFMPEG PATCH FOR MINGW

Related pages on www.mikekohn.net: Naken Web, Axis DBus

Introduction

FFMPEG is a set of libraries (libavcodec, libavformat, libavutil) for reading and writing audio/video file formats and decompressing and compressing their contents. In other words, FFMPEG is a program that can play audio and video files, do image processing on them, and create new files in many different formats. If you'd like to learn more about it, you can look at their webpage: http://ffmpeg.sourceforge.net/

My Patch

I was working on a project for connecting to an Axis 213 camera to read mpeg4 video in an RTSP stream. I was using the FFMPEG libraries to do this, but unfortunately the networking code only worked on Unix and BEOS operating systems and I need a cross platform solution. I submitted my patch to the FFMPEG people, and altho some of the people wanted to accept my patch, some of the people higher up in the project did not want to accept my patches, therefore I'm posting them here for anyone who needs networking support on Windows with FFMPEG. I really don't understand why Windows is such a big deal to them. I mean if people enjoy bobbing for apples in a toilet full of poop, I say let them.

NOTE: I am not a part of the FFMPEG team. I just simply changed a few lines of their code to make it compile and run on Windows.

CHANGES IN LATEST 2008 PATCH ARE:

  • UDP receive buffer size raised
  • #define usleep
  • Added gettimeofday()

CHANGES IN LATEST 2006 PATCHES ARE:

  • Change configure to allow network under MingW
  • Clean up BeOS headers and include MingW
  • Get rid of calls to the function read()/write() and change to cross-platform recv()/send()
  • Raise the size of the socket buffer
  • Fix a bug that allows ffmpeg to bind to more ports so that multiple instances of ffplay can run
  • Probably more stuff I'm forgetting

Note: The ffmpeg team has actually fixed most, if not everything that the 2006 patches take care of. For some reason I think they didn't fix the udp buffer length problems on Windows and they left out a Windows equivalent of usleep() and gettimeofday(). The 2008 patch here takes care of that.

Download

The 2006-11-05 patch works on Subversion code as of November 05, 2008

ffmpeg_kohn_rtsp_mingw-2008-11-05.patch
ffmpeg_kohn_rtsp_mingw-2006-11-09.patch
ffmpeg_kohn_rtsp_mingw-2006-11-08.patch
ffmpeg_kohn_rtsp_mingw-2006-11-06.patch
ffmpeg_kohn_rtsp_mingw-2006-06-23.patch
ffmpeg_kohn_rtsp_mingw-2006-04-03.patch

Install

To install this, download the latest svn version as mentioned on their page http://ffmpeg.sourceforge.net/download.php and apply the patch by typing:

svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
cat ffmpeg_kohn_rtsp_mingw_2008-11-05.patch | patch -p0

Then run the configure script within MSYS and type: make

NOTE: This will not make FFMPEG compile with Microsoft Visual C++. FFMPEG written to compile with gcc so it requires the MINGW gcc compiler.

To build with a cross compiler on Gentoo Linux I configure with

./configure --target-os=mingw32 --enable-cross-compile --arch=x86 --cpu=pentium4 --cross-prefix=i386-mingw32msvc- --extra-cflags=-D__STDC_LIMIT_MACROS

Copyright 1997-2018 - Michael Kohn