Feature Request - Enable pthreads in ffmpeg

Matthew
2010-02-01
2013-05-02
1 2 > >> (Page 1 of 2)
  • Matthew
    Matthew
    2010-02-01

    One last request - the "thread emulation" warning showing up is (I think) due to your ffmpeg not being compiled with any actual thread libraries.  Mac OS X supports POSIX threads, so if you add the 

    --enable-pthreads[/code]
    
     
  • MoonDogg
    MoonDogg
    2010-02-08

    You can do this yourself and replace the ffmpeg that is packaged with videomonkey… I have done it and it works great…

     
  • Sean
    Sean
    2010-02-08

    moondogg, can you post some details one what you did to build ffmpeg?  I made an attempt at it once but couldn't get it to compile, so if you could post where you got hte code, and what steps were needed to build it that would be fantastic.

    Thanks!

     
  • MoonDogg
    MoonDogg
    2010-02-12

    Sure… First I figured out everything I wanted to compile with it.  So I decided I wanted to use these additional components
    libx264, FAAC, FAAD & lamemp3.  I think all you need for video monkey is libx264.  You will also need the yasm assembler for one of these components.

    So you will have to download and compile each of these additional components separately before you compile ffmpeg.

    yasm:
    Download tarball from here: http://www.tortall.net/projects/yasm/wiki/Download
    Open terminal, and change directory that tarball makes, then input this into terminal.

    ./configure
    make && sudo make install
    

    lame MP3:
    Get the latest tarball from https://sourceforge.net/projects/lame/files/lame/
    open terminal
    go to the directory that the tarball  make after opening it. And perform the follwoing terminal commands

    ./configure
    make && sudo make install
    

    FAAC & FAAD:
    download the bootstrapped tarballs from here http://www.audiocoding.com/downloads.html
    open terminal and change the directory the tarballs make and put in the following commands.

    ./configure
    make && sudo make install
    

    libx264:
    You will need the git installer for OS X get it here: http://code.google.com/p/git-osx-installer/
    The you will need to "git" libx264

    git clone git://git.videolan.org/x264.git
    

    In terminal will make a directory x264 and download the source code for it. Then do this:

    cd x264
    ./configure
    make && sudo make install
    

    Now you can get and combile ffmpeg:

    Get the latest svn release by putting the folowing into terminal:

    svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
    

    This is also going to make a sub directory in whatever directory you are in when you put that command in terminal.
    Next to this:

    cd ffmpeg
    ./configure --arch=x86_64 --enable-nonfree --enable-pthreads --enable-runtime-cpudetect --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libx264
    make && sudo make install
    
     
  • Matthew
    Matthew
    2010-02-15

    moondogg, great tutorial on the ffmpeg compile - I know a lot of folks have been hunting for this.  I've actually done this as well, but I still think the request stands.  There's really no reason not to enable pthreads in the ffmpeg binary included in VideoMonkey and it will save a lot of hassle for the folks not necessarily up to swapping out the binaries.

    One side note, the included build of ffmpeg does have a few other flags you might want to include assuming video scaling and filters get turned on in future versions:

    --disable-ffplay --disable-ffserver --enable-gpl --enable-postproc --enable-avfilter --enable-avfilter-lavf --enable-libvorbis --enable-libtheora --enable-libxvid
    

    Just a heads up.  Obviously you'll need to download/compile these as well!

     
  • MoonDogg
    MoonDogg
    2010-02-15

    Yes.. I noticed… after I downloaded the source code for the videomonkey…    I did all that except the disable ffplay and ffserver and I was unable to successfully compile xvid yet…  but I just updated my ffmpeg with the other stuff…    I am still using the 0.5 release with my ffmpeg… anyone know if the latest svn fixed the memory leak in 0.6?  I see a couple notes about it…  but just wondering if he got them all yet? 

     
  • MoonDogg
    MoonDogg
    2010-02-15

    Well I successfully compiled xvid so here is the new config command:

    ./configure --arch=x86_64 --enable-nonfree --enable-pthreads --enable-runtime-cpudetect --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libx264 --enable-libvorbis --enable-libtheora --enable-gpl --disable-ffplay --disable-ffserver --enable-postproc --enable-avfilter --enable-avfilter-lavf --enable-libvorbis --enable-libtheora --enable-libxvid
    
     
  • MoonDogg
    MoonDogg
    2010-02-15

    ooops here ya go… 

    ./configure --arch=x86_64 --enable-nonfree --enable-pthreads --enable-runtime-cpudetect --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libx264 --enable-libvorbis --enable-libtheora --enable-gpl --disable-ffplay --disable-ffserver --enable-postproc --enable-avfilter --enable-avfilter-lavf  --enable-libxvid
    
     
  • MoonDogg
    MoonDogg
    2010-02-16

    Ok, well I answered my own ? its looks like he got the memory leaks fix. I built the latest SVN (330) and it works great…  (btw I used my ffmpeg using the latest SVN of that also….) oh and I understand about the request standing… I was just saying in the mean time you can do it yourself if you wanted to…   :-)

    also. Chris.. you doing an excellent job keep it up… 

     
  • Dave Healey
    Dave Healey
    2010-02-20

    Hi moondogg,

    I appreciate your guide, I would have never managed this on my own.

    I am having a problem though, everything has gone fine up to the last point trying to compile ffmpeg.

    I have followed your instructions, substituting the "./configure" line for the last one dated: 2010-02-16 19:12:13 GMT
    but I am getting:

    "  : ./configure -arch=x86_64 -enable-nonfree -enable-pthreads -enable-runtime-cpudetect -enable-libfaac -enable-libfaad -enable-libmp3lame -enable-libx264 -enable-libvorbis -enable-libtheora -enable-gpl -disable-ffplay -disable-ffserver -enable-postproc -enable-avfilter -enable-avfilter-lavf -enable-libxvid
    ERROR: libtheora not found"

     
  • Dave Healey
    Dave Healey
    2010-02-20

    Oh, scrap that, I missed hemsatmj's message about the additional modules needing to be downloaded :-)

     
  • MoonDogg
    MoonDogg
    2010-02-20

    :-)   Glad you got it.

     
  • Dave Healey
    Dave Healey
    2010-02-20

    Actually, I'm still having problems.

    I ended up downloading "ffmpeg-checkout-2010-02-19" and compiling that using the above ".configure" line.
    I copied the resulting ffmpeg into the "bin" directory of my existing downloaded VideoMonkey 0.6 version.

    When I open console and hit start, I'm getting the following error:

    ->     Stream #0.1: Audio: mp3, 48000 Hz, 2 channels, s16, 128 kb/s
         -> File for preset 'fastest' not found

    Wierd, since the only thing I have changed is the ffmpeg binary and it runs fine on "fastest" with the original ffmpeg.
    On a plus not, if I change to "fast", it does work successfully and if I watch in Activity Monitor, I can now see that the ffmpeg is registering as "intel (64 bit)" and my processor is significantly higher whilst its operating compared to the original ffmpeg!
    The only downside being that it doesn't seem to be going much faster as I'm having to run at the "fast" preset.

     
  • Dave Healey
    Dave Healey
    2010-02-20

    whooah, I think I managed to fix that myself!

    I know that might seem trivial to some of you guy's, but when it comes to the "compiling competence" scales, with the left side being "competent" and the right side being  "Has no business being here", my scales are constantly wavering from being balanced to weighted more on the right side :-)

     
  • MoonDogg
    MoonDogg
    2010-02-20

    So you got it or still need help?

     

  • Anonymous
    2010-02-20

    If you've fixed this, why not just post a binary?

     
  • Dave Healey
    Dave Healey
    2010-02-20

    I got it thanks. I just had to copy the ffpresets from the VideoMonkey folder to the ffmpeg folder and re-compile.

    I'm now onto something completely difference I want to address:

    https://sourceforge.net/projects/videomonkey/forums/forum/884113/topic/3561230

    Although I think I might be out of my depth here :-)

     
  • Sean
    Sean
    2010-04-01

    I finally got around to coming back to this thread.  Thanks for the instructions moondogg!  They worked fantastic, and I know have my own ffmpeg built.

     
  • Roopesh Sheth
    Roopesh Sheth
    2010-07-28

    healeydave or moondogg,

    I copied the ffpresets into the ffmpeg/ffpresets dir and build ffmpeg.  However, when I move my static ffmpeg into the VideoMonkey bin dir and try to run VideoMonkey, I still get the error saying it can't find the normal preset.  Any advice?

    Thanks

     
  • MoonDogg
    MoonDogg
    2010-07-28

    roopeshsheth ,

    The only thing I can think of right now is that if you have previous build files in the ffmpeg directory when building a new build somethings don't work right… so my suggestion would be to either use a diff directory or delete your current ffmpeg directory and recreate it (downloading the current SVN is a good way to do that or unpackage a tarball) and then copy the ffpresets from video monkey into the ffmpeg directory and then compile ffmpeg.  I hope this works out for you.. let me know..

     
  • Roopesh Sheth
    Roopesh Sheth
    2010-07-28

    So I had to configure and build with the datadir pointed to the ffpresets dir:

    ./configure --disable-ffplay --disable-ffserver --enable-gpl --enable-postproc --enable-avfilter --enable-avfilter-lavf --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-libxvid --arch=x86_64 --enable-pthreads --disable-shared --enable-static --enable-nonfree --datadir=/Applications/VideoMonkey.app/Contents/Resources/ffpresets
    

    Now it seems to work.  Thanks!

     
  • First of all, many thanks for the ffmpeg, but i find some problems:
    1) The ffmpeg are compiled with a static datadir path. If the VM not are in the Applications folder, the ffmpeg not work because not find the ffpresets. Try to compile with relative datadir path, like ../ffpresets
    2) The libtheora are dynamic (this is the console log of the error: dyld: Library not loaded: /usr/local/lib/libtheoraenc.1.dylib). I don't know how to solve this, sorry.
    Best regards  

     
  • First of all, many thanks for the ffmpeg, but i find some problems:
    1) The ffmpeg are compiled with a static datadir path. If the VM not are in the Applications folder, the ffmpeg not work because not find the ffpresets. Try to compile with a relative datadir path, like ../ffpresets
    2) The libtheora are dynamic (this is the console log of the error:

    dyld: Library not loaded: /usr/local/lib/libtheoraenc.1.dylib)
    

    I don't know how to solve this, sorry.
    The message it's repeated, this is because i cannot edit the original message.

     
  • I am in the process of doing this rebuild, and I want to add notes:

    I had a problem building lame because the path to where I was building it had a space in it.  I have seen this problem before when building Unix/Linux stuff on Mac.  So I just replaced the space with a dash and everything went fine.

    More as it happens

     
1 2 > >> (Page 1 of 2)