Difference between ubuntu and windows version of ffmpeg

Issues involving a Windows version of FFmpeg. Do not post general usage questions here.

Difference between ubuntu and windows version of ffmpeg

Postby marcjn » Tue Jun 21, 2011 4:02 am

Hi, I am new to this forum. I installed Ubuntu in Virtualbox in a Windows XP platform, primarily to be able to cross compile ffmpeg and use it in Windows.
It's not been obvious, but I have a preliminary build in my Ubuntu system, that provides the following information, from the Ubuntu terminal:
Code: Select all
FFmpeg version 0.6.2-4:0.6.21ubuntu1, Copyright (c)2000-2010 the Libav developers built on Mar 22 2011 15:55:04 with gcc 4.5.2
configuration:
--extra-version=4:0.6.2-1ubuntu1
--prefix=/usr
--enable-avfilter
--enable-avfilter-lavf
--enable-vdpau
--enable-bzlib
--enable-libgsm
--enable-libschroedinger
--enable-libspeex
--enable-libtheora
--enable-libvorbis
--enable-pthreads
--enable-zlib
--enable-libvpx
--disable-stripping
--enable-runtime-cpudetect
--enable-vaapi
--enable-gpl
--enable-postproc
--enable-swscale
--enable-x11grab
--enable-libdc1394
--enable-shared
--disable-static
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
Hyper fast Audio and Video encoder

When I copy the build folder to a USB drive (share folders with Windows are giving me headaches) and then to Windows, this ffmpeg application is telling me the following from the Windows command prompt:
Code: Select all
FFmpeg version SVN-r26402, Copyright (c) 2000-2011
the FFmpeg developers   built on Mar  3 2011 19:51:16 with gcc 4.4.2
  configuration:
  --enable-memalign-hack
  --arch=x86
  --target-os=mingw32
  --cross-prefix=i686-mingw32-
  libavutil     50.36. 0 / 50.36. 0
  libavcore      0.16. 1 /  0.16. 1
  libavcodec    52.108. 0 / 52.108. 0
  libavformat   52.93. 0 / 52.93. 0
  libavdevice   52. 2. 3 / 52. 2. 3
  libavfilter    1.74. 0 /  1.74. 0
  libswscale     0.12. 0 /  0.12. 0
Hyper fast Audio and Video encoder

Is it possible that when I compile ffmpeg under Ubuntu, the version I see in Windows looks that different? Am I missing something obvious? Very perplexed !
Thanks for any help or any comment.
Jean
marcjn
 
Posts: 43
Joined: Tue Jun 21, 2011 12:36 am

Re: Difference between ubuntu and windows version of ffmpeg

Postby Zeranoe » Tue Jun 21, 2011 4:46 pm

First of all your compiling the svn, you should be compiling the git.

I'm also a bit confused with your question, did you compile the Windows version yourself?

If so those flags you see are the ones that you used to compile FFmpeg, you are free to change them.
User avatar
Zeranoe
Site Admin
 
Posts: 543
Joined: Sat May 07, 2011 7:12 pm

Re: Difference between ubuntu and windows version of ffmpeg

Postby marcjn » Tue Jun 21, 2011 6:37 pm

First of all your compiling the svn, you should be compiling the git.

I am really a newbie in this area, and I am not sure where this would fit for me.
I'm also a bit confused with your question, did you compile the Windows version yourself?
If so those flags you see are the ones that you used to compile FFmpeg, you are free to change them.

This is what I did: I have been trying to follow the instructions from http://www.ffmpeg.arrozcru.com/wiki, pretty much as follows:
    - Installed VirtualBox
    - Installed Ubuntu 10.10 (now upgraded to 11.04)
    - Installed the mingw32 toolchain: mingw32-w32api, mingw32-runtime, mingw32-gcc-4.4, mingw32-binutils following http://www.ffmpeg.arrozcru.com/wiki/ind ... repository, including the patches for the MinGW header files.
    - Followed the cross-compilation instructions in http://www.ffmpeg.arrozcru.com/wiki/ind ... -compiling:
      * installed yasm and subversion
      * created the svn and build directories
      * ran: sudo ../svn/configure --enable-memalign-hack --arch=x86 --target-os=mingw32 --cross-prefix=i686-mingw32-

Now, I was at this point trying to make the process work, not yet trying to get all the options I need, and my plan is to go back and get the right configuration (I want to have avisynth, libx264, libxvid, libmp3lame, libfaac amoung others). The next step for me was not explained in http://www.ffmpeg.arrozcru.com: how to take the build, and use it in Windows. What I did was copy the build folder and paste it in my C:/Program Files folder.
I am somewhat happy that ffmpeg runs under Ubuntu and under Windows, so, my problem is not that I don't get the options I would like to have, I will change that, but I don't understand why the same configuration looks different under Ubuntu and under Windows: different options and different versions. I am sure there is something I am missing.
marcjn
 
Posts: 43
Joined: Tue Jun 21, 2011 12:36 am

Re: Difference between ubuntu and windows version of ffmpeg

Postby Zeranoe » Tue Jun 21, 2011 8:16 pm

First of all the directions at that wiki are a bit outdated. Here is the step process I would recommend:
  1. Remove those mingw toolchain packages you found at that wiki.
  2. Grab the latest version of my mingw-w64 build script here: http://ffmpeg.zeranoe.com/blog/?cat=4
  3. Install git:
    Code: Select all
    sudo apt-get install git-core
  4. Checkout the FFmpeg git source in the source directory:
    Code: Select all
    git clone git://git.videolan.org/ffmpeg.git ffmpeg-git
  5. If you closed the terminal window your working in, or if you didn't follow the last step of the mingw-w64 build script, export the mingw-w64 bin path with:
    Code: Select all
    export PATH="$PATH:/path/to/your/mingw-w64 i686/bin"
    it is important that it points to your mingw-w64 i686 bin path.
  6. Configure FFmpeg with:
    Code: Select all
    ../source/ffmpeg-git/configure --enable-memalign-hack --arch=x86 --target-os=mingw32 --cross-prefix=i686-w64-mingw32-
    in the build directory
  7. If you didn't add --prefix to the configure then a "sudo make install" will be needed to install the packages to /usr/local I do not recommend this though and you should add a prefix that points to a location within your home directory. If you don't know where your home directory is, try:
    Code: Select all
    cd ~; pwd
    this command will print where your home directory is, point the prefix to somewhere under that. Then, after "make install" is run, you can find the resulting FFmpeg in the prefix you specified

The reason your seeing the differences in the configure options between Windows and Ubuntu is because Windows requires different options to tell FFmpeg to build for Windows.
User avatar
Zeranoe
Site Admin
 
Posts: 543
Joined: Sat May 07, 2011 7:12 pm

Re: Difference between ubuntu and windows version of ffmpeg

Postby marcjn » Tue Jun 21, 2011 11:51 pm

Thanks a lot. I will try that.
marcjn
 
Posts: 43
Joined: Tue Jun 21, 2011 12:36 am

Re: Difference between ubuntu and windows version of ffmpeg

Postby marcjn » Wed Jun 22, 2011 4:24 pm

OK, I downloaded the script mingw-w64-build-1.9.0, and ran it. It first asked for a few packages (bison m4 flex) whick I installed.
I re-started the script, selected the 32-bit version only, the default options, and 2 cores. The script ran, then stopped for a long while at the line 'A winpthreads/makefile.old' under the heading 'Checked out revision 4225'.
It is now definitely stopped with the following:
Code: Select all
A    winpthreads/build-aux/config.sub
A    winpthreads/build-aux/install-sh
A    winpthreads/makefile.old

svn: REPORT of '/svnroot/mingw-w64/!svn/vcc/default': Could not read response body: connection timed out (http://mingw-w64.svn.sourceforge.net)


Edit: the second attempt of running the script was successful.
Will take on the other steps tomorrow.
Last edited by marcjn on Wed Jun 22, 2011 9:08 pm, edited 1 time in total.
marcjn
 
Posts: 43
Joined: Tue Jun 21, 2011 12:36 am

Re: Difference between ubuntu and windows version of ffmpeg

Postby Zeranoe » Wed Jun 22, 2011 7:05 pm

If it still doesn't work after a retry it's an issue with the mingw-w64's svn server.

I would keep trying until the server issue is resolved.
User avatar
Zeranoe
Site Admin
 
Posts: 543
Joined: Sat May 07, 2011 7:12 pm

Cross-compiling ffmpeg with Zeranoe's mingw-w64 script

Postby marcjn » Fri Jun 24, 2011 9:52 pm

So the mingw-w64 build script ran fine as I said earlier.
I then followed step 3: install git-core, step 4: checkout ffmpeg git source, step 5, export PATH.
In the mean time, I also ran the ./configure command after downloading faac-1.28:
Code: Select all
~/fflib/faac/faac-1.28$ ./configure --host=i686-mingw32 --prefix=/usr/i686-mingw32 --enable-static --disable-shared --with-mp4v2=no

Apparently, it ran smoothly.

Now, step 6: configure ffmpeg is not working for me. Here is my command and the following message from the console:
Code: Select all
jn@jn-VirtualBox:/ffmpeg/mingw-w64/source$ ../source/ffmpeg-git/configure --pkg-config=pkg-config --prefix=/ffmpeg/build2 --enable-memalign-hack --arch=x86 --target-os=mingw32 --cross-prefix=i686-w64-mingw32-
i686-w64-mingw32-gcc is unable to create an executable file.
C compiler test failed.

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solving the problem.

Note that I inserted --pkg-config=pkg-config following your comment on http://ffmpeg.arrozcru.org/forum/viewtopic.php?f=1&t=1710

The end of my config.log contains the following lines:
Code: Select all
WARNING: Unknown C compiler i686-w64-mingw32-gcc, unable to select optimal CFLAGS
check_ld
check_cc
BEGIN /tmp/ffconf.9nzSufdj.c
    1   int main(void){ return 0; }
END /tmp/ffconf.9nzSufdj.c
i686-w64-mingw32-gcc -c -o /tmp/ffconf.dZDNgrqn.o /tmp/ffconf.9nzSufdj.c
../source/ffmpeg-git/configure: 2349: i686-w64-mingw32-gcc: not found
C compiler test failed.

I am not sure what the issue is, why the gcc compiler is not recognized (I checked that i686-w64-mingw32-gcc is in /ffmpeg/mingw-w64/mingw-w64-i686/bin). Any input will be much appreciated. One thing I am somewhat uncertain about is how the directories should be organized and whether the right file in the wrong directory might create issues. I really want to make this work.
marcjn
 
Posts: 43
Joined: Tue Jun 21, 2011 12:36 am

Re: Difference between ubuntu and windows version of ffmpeg

Postby Zeranoe » Fri Jun 24, 2011 10:09 pm

Your mingw-w64 bin directory is not in your PATH variable.

You can see your current paths with:
Code: Select all
echo "$PATH"


If you don't see your path to your mingw-w64 bin directory in that then it is not exported.

Keep in mind that if you close the terminal window your working in, you will need to re-export the path again so that FFmpeg can find it in the new window.

Also, you didn't actually use mingw-w64 to compile FAAC, you need to use i686-w64-mingw32 for your --host option to compile it with mingw-w64.

Also, that --pkg-config=pkg-config can be fixed with running:

Code: Select all
ln -s "/usr/bin/pkg-config" ./i686-w64-mingw32-pkg-config

within the i686 mingw-w64 bin directory

(this will create a link to pkg-config and with that added you can remove the "--pkg-config=pkg-config")

Or you could just use that --pkg-config=pkg-config command.

Lastly, like I said you shouldn't be compiling in the source directory, make another directory so that you can compile in that and then simply remove all the files within to clear and make a new build, then link back to the configure script when inside that directory (../source/ffmpeg-git/configure) for example.

Since you tried to run it already in the source directory, run a "make distclean" within that source directory, or re-checkout the source.
User avatar
Zeranoe
Site Admin
 
Posts: 543
Joined: Sat May 07, 2011 7:12 pm

Re: Cross-compiling ffmpeg with Zeranoe's mingw-w64 script

Postby marcjn » Fri Jun 24, 2011 10:38 pm

Wow, thanks for the ultra fast suggestions! Really appreciated it.
If you don't see your path to your mingw-w64 bin directory in that then it is not exported.
Right! I had forgotten that.
Also, you didn't actually use mingw-w64 to compile FAAC, you need to use i686-w64-mingw32 for your --host option to compile it with mingw-w64.
Also, that --pkg-config=pkg-config can be fixed with running:
Code: Select all
ln -s "/usr/bin/pkg-config" ./i686-w64-mingw32-pkg-config

within the i686 mingw-w64 bin directory
I'll try to do that.
Lastly, like I said you shouldn't be compiling in the source directory
Actually, my intention was to compile in a build directory, distinct from the source directory, this is what I thought I would accomplish with --prefix=/ffmpeg/build2, but I probably misunderstood that command. So, if I want to build ffmpeg in the /ffmpeg/build directory, should I run the command from within the directory? something like:
Code: Select all
jn@jn-VirtualBox:/ffmpeg/build2$ ../source/ffmpeg-git/configure ...

Thanks again.
marcjn
 
Posts: 43
Joined: Tue Jun 21, 2011 12:36 am

Next

Return to Usage Issues

Who is online

Users browsing this forum: No registered users and 2 guests