nikitaporje / xuggle

Automatically exported from code.google.com/p/xuggle
0 stars 0 forks source link

Add libx264 functionality to the default Xuggler build #36

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Right now, Xuggler doesn't support encoding as h.264 out of the box.  If we
incarcerated x264 into the build, then it would.

Original issue reported on code.google.com by art.cla...@gmail.com on 22 Jan 2009 at 5:08

GoogleCodeExporter commented 8 years ago
I vote for this too!

Original comment by legege on 25 Jan 2009 at 1:45

GoogleCodeExporter commented 8 years ago
I'm doing a patch for that. I'm wondering where is copied the libx/csrc 
directory to
build/native/... before compilation?

Original comment by legege on 26 Jan 2009 at 6:36

GoogleCodeExporter commented 8 years ago
Hi Georges,

The "right" way to do it is to either (a) check the source out into
captive/libx264/csrc everytime we do a "svn up" or (b) add it directly. 
Unfortunately libx264 uses git not SVN, and I don't want to add git as a 
dependency
to our build system.  So for now, we'll need to pick a libx264 version that we 
think
is good and check in a copy of the source (that's what we do for libmp3lame and
libspeex).

Once the source is added, an incarceration script needs to be created.  If 
libx264
uses automake then it's relatively easy; just copy the approach in 
captive/libmp3lame
(i.e. create an incarcerate.in script).

Then configure.ac and the relative Makefile.am files need to be changed to know 
to
generate the right incarceration scripts from your incarcerate.in template and 
build
that library.  And autoreconf needs to be run with the right versions (it'll 
give you
a error if it's the wrong version)

Once you're there, I'd re-do the build to make sure libx264 seems to build, but 
it
won't yet be used by ffmpeg.

Then captive/ffmpeg/incarcerate.in needs to be changed to pass in an option to 
ffmpeg
to tell it about libx264.

Next (and this is the hardest part), a test needs to be added to
csrc/com/xuggle/xuggler/StreamCoderTest.cpp and .h to test encoding a libx264 
file
and our memcheck suite must be run on Linux.  This is to detect if libx264 
behaves
well with memory allocations and has no corruptions -- if it doesn't pass, 
it'll end
up making Java unstable and therefore won't be something we'll include.

Finally, test/src/com/xuggle/xuggler/ConverterTest.java should have a test 
added that
makes sure we can encode h264 from Java.  There is already a h264 encoded test 
file
in test/fixtures that can be used as input.

I really appreciate any help with the patch, but it's complicated :)  We're 
focused
on fixing the bugs you've found at the moment, but I expect I'll return to this 
in
force once we've made good progress on the bugs and our launch demo for FITC.  
At
worst, that'll be March.

- Art

Original comment by art.cla...@gmail.com on 26 Jan 2009 at 6:51

GoogleCodeExporter commented 8 years ago
Thanks Art, I'm just before the step of adding a test case, but compilation 
doesn't
work because csrc directory is not copied in the build directory. The dist-hook 
is
not called. Any idea? Here is preliminarily patch if it helps...

Original comment by legege on 26 Jan 2009 at 7:05

Attachments:

GoogleCodeExporter commented 8 years ago
Attach the incarcerate.in and Makefile you're using for libx264, and the output 
of
the build and I'll try to figure it out (couldn't easily determine the problem 
from
your patch, but you look to be doing it in the right way).

Original comment by art.cla...@gmail.com on 26 Jan 2009 at 7:15

GoogleCodeExporter commented 8 years ago
Thanks Art,

Here is the output:
    [exec] Configuring X264 with these options: 
--extra-cflags=-I/Users/legege/ffmpeg-tests/xuggle-trunk/java/xuggle-xuggler/bui
ld/native/i386-apple-darwin9.6.0/captive/usr/local/include
--extra-ldflags=-L/Users/legege/ffmpeg-tests/xuggle-trunk/java/xuggle-xuggler/bu
ild/native/i386-apple-darwin9.6.0/captive/usr/local/lib
--enable-shared --disable-asm
     [exec]
/Users/legege/ffmpeg-tests/xuggle-trunk/java/xuggle-xuggler/build/native/i386-ap
ple-darwin9.6.0/../../../captive/libx264/csrc/configure:
line 170: ./config.guess: No such file or directory
     [exec]
/Users/legege/ffmpeg-tests/xuggle-trunk/java/xuggle-xuggler/build/native/i386-ap
ple-darwin9.6.0/../../../captive/libx264/csrc/configure:
line 173: ./config.sub: No such file or directory
     [exec] Unknown system , edit the configure
     [exec] Could not configure library:
"/Users/legege/ffmpeg-tests/xuggle-trunk/java/xuggle-xuggler/build/native/i386-a
pple-darwin9.6.0/../../../captive/libx264";
you may want to try disabling it or installing your own version
     [exec] make[2]: ***
[/Users/legege/ffmpeg-tests/xuggle-trunk/java/xuggle-xuggler/build/native/i386-a
pple-darwin9.6.0/captive/libx264/csrc/Makefile]
Error 1
     [exec] make[1]: *** [install-recursive] Error 1
     [exec] make: *** [install-recursive] Error 1

And:
$ ls
/Users/legege/ffmpeg-tests/xuggle-trunk/java/xuggle-xuggler/build/native/i386-ap
ple-darwin9.6.0/captive/libx264/csrc/
  (empty!)

$ ls
/Users/legege/ffmpeg-tests/xuggle-trunk/java/xuggle-xuggler/build/native/i386-ap
ple-darwin9.6.0/../../../captive/libx264/csrc/
AUTHORS     Makefile    config.guess    config.sub  encoder     matroska.h  tools       x264.h
COPYING     build       config.h    configure   extras      muxers.c    version.sh  x264.pc
Doxyfile    common      config.mak  doc     matroska.c  muxers.h    x264.c

Original comment by legege on 26 Jan 2009 at 7:20

Attachments:

GoogleCodeExporter commented 8 years ago
(I did a "ant clobber" before)

I'm "able" to get this message:
     [exec] Configuring FFMPEG with these options: 
--extra-cflags=-I/Users/legege/ffmpeg-tests/xuggle-trunk/java/xuggle-xuggler/bui
ld/native/i386-apple-darwin9.6.0/captive/usr/local/xuggle/include
--extra-ldflags=-L/Users/legege/ffmpeg-tests/xuggle-trunk/java/xuggle-xuggler/bu
ild/native/i386-apple-darwin9.6.0/captive/usr/local/xuggle/lib
--enable-shared --disable-stripping --enable-gpl --enable-swscale 
--enable-libx264
--enable-libmp3lame --enable-libspeex --extra-cflags=-m64 --extra-ldflags=-m64
--enable-pthreads --arch=x86_64 --extra-cflags=-arch --extra-cflags=x86_64
--extra-ldflags=-arch --extra-ldflags=x86_64
     [exec] ERROR: libx264 not found
     [exec] If you think configure made a mistake, make sure you are using the latest
     [exec] version from SVN.  If the latest version fails, report the problem to the
     [exec] ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
     [exec] Include the log file "config.err" produced by configure as this will help
     [exec] solving the problem.
     [exec] Could not configure library:
"/Users/legege/ffmpeg-tests/xuggle-trunk/java/xuggle-xuggler/build/native/i386-a
pple-darwin9.6.0/../../../captive/ffmpeg";
you may want to try disabling it or installing your own version

Attached is a screenshot of build/native/platform/captive

Original comment by legege on 26 Jan 2009 at 8:01

Attachments:

GoogleCodeExporter commented 8 years ago
Attached is the build log for ffmpeg.

Original comment by legege on 26 Jan 2009 at 8:18

Attachments:

GoogleCodeExporter commented 8 years ago
Full log!

Original comment by legege on 26 Jan 2009 at 8:29

Attachments:

GoogleCodeExporter commented 8 years ago
First working patch (compilation). Need testing and tests, and certainly 
adjustments
for Windows compilation.

Original comment by legege on 26 Jan 2009 at 9:51

Attachments:

GoogleCodeExporter commented 8 years ago
Cleaned up patch!

Original comment by legege on 26 Jan 2009 at 10:08

Attachments:

GoogleCodeExporter commented 8 years ago
Here is a new version:
 - In sync with the trunk (r127)
 - C++ test case in test/csrc/com/xuggle/xuggler/StreamCoderTest.cpp
   * It seams some file contains ^M and triggers difference where I haven't done
anything.
 - Java test case in test/src/com/xuggle/xuggler/ConverterTest.java

I welcome any comments. Please note that I don't have a valgrind memory testing
environment yet. If you already have that, it would be interesting to see if 
nothing
leaks.

Original comment by legege on 27 Jan 2009 at 2:51

Attachments:

GoogleCodeExporter commented 8 years ago
Well... I forget to do svn add on captive/libx264. Here is a complete patch.

Need help:
 - captive/libx264/Makefile.in, I'm not sure what to do for each Makefile target
(e.g. uninstall).

Original comment by legege on 27 Jan 2009 at 2:56

Attachments:

GoogleCodeExporter commented 8 years ago
Hi Georges,

No need to attach the libx264 in the patch; just tell me what GIT revision 
you're using.

- Art

Original comment by art.cla...@gmail.com on 27 Jan 2009 at 5:55

GoogleCodeExporter commented 8 years ago
The patch doesn't contain the libx264, it just that makefiles and scripts in 
libx264
(not csrc) were not included. The version is in the README file.

Original comment by legege on 27 Jan 2009 at 11:46

GoogleCodeExporter commented 8 years ago
going to see if we can get this in RC5

Original comment by art.cla...@gmail.com on 2 Feb 2009 at 6:35

GoogleCodeExporter commented 8 years ago
Let me know if you need my help for that. Once in the trunk, if not enabled by 
default, it could be useful to 
provide Windows builds for it, if possible... You know, we all love how easy it 
is to build good software on 
Windows. :)

Original comment by legege on 3 Feb 2009 at 12:59

GoogleCodeExporter commented 8 years ago
So it turns out that libx264 doesn't run "Valgrind clean" on Linux.  There are 
lots
of unitialized variables and value uses, and there are some memory leak reports.

The leaks are non issues -- they are static variables that are really start-up 
costs
with no clean-up but the variables may be larger.

I'm going to open a new bug to encourage us to eventually track down the 
Valgrind errors.

Original comment by art.cla...@gmail.com on 3 Feb 2009 at 8:01

GoogleCodeExporter commented 8 years ago
See:
http://code.google.com/p/xuggle/issues/detail?id=53
for the other issue.

Original comment by art.cla...@gmail.com on 3 Feb 2009 at 8:03

GoogleCodeExporter commented 8 years ago
Initial checkin is in r154.  This breaks the build, but I will be fixing later 
today.

Original comment by art.cla...@gmail.com on 3 Feb 2009 at 8:51

GoogleCodeExporter commented 8 years ago
And last checkin in r168.

Thanks Georges for your starting patches.  I had to make a few edits, but your 
code
was a great starting point.

Original comment by art.cla...@gmail.com on 7 Feb 2009 at 2:34

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
hiii art,

   i need your help .

      when i was running ffmpeg then i was getting

[ratna@orion1 xuggle-xuggler]$ ffmpeg 
ffmpeg: /lib/libc.so.6: version `GLIBC_2.7' not found (required by ffmpeg)
ffmpeg: /lib/libc.so.6: version `GLIBC_2.7' not found (required by 
/usr/local/xuggler/lib/libavformat.so.52)
ffmpeg: /lib/libc.so.6: version `GLIBC_2.7' not found (required by 
/usr/local/xuggler/lib/libavcodec.so.52)
ffmpeg: /lib/libc.so.6: version `GLIBC_2.7' not found (required by 
/usr/local/xuggler/lib/libx264.so.83)

but i we can't upgrade my Linux libc.so.6: version `GLIBC_2.5' to version 
`GLIBC_2.7'

at one place i got your one more solution 
    checkout xuggler code from svn and build that 
svn checkout http://xuggle.googlecode.com/svn/trunk/java/xuggle-xuggler

i took source code but when i am runing ltmain.sh 
in last i am getting 

[ratna@orion1 xuggle-xuggler]$ ./ltmain.sh
./ltmain.sh: line 111: CDPATH: command not found
./ltmain.sh: line 162: /opt/local/bin/gsed: No such file or directory
./ltmain.sh: line 168: /opt/local/bin/gsed: No such file or directory
: Version mismatch error.  This is libtool 2.2.6, but the
: definition of this LT_INIT comes from an older release.
: You should recreate aclocal.m4 with macros from libtool 2.2.6
: and run autoconf again.

and when i build it error was :

    [exec] Configuring FFMPEG with these options:  --extra-version=xuggle-4.0.900 --extra-cflags=-I/home/ratna/xuggler/xuggle-xuggler/build/native/i686-pc-linux-gnu/captive/usr/local/xuggler/include --extra-ldflags=-L/home/ratna/xuggler/xuggle-xuggler/build/native/i686-pc-linux-gnu/captive/usr/local/xuggler/lib --enable-shared --enable-gpl --enable-nonfree --enable-version3 --enable-libx264 --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-pthreads
     [exec] yasm not found, use --disable-yasm for a crippled build
     [exec] 
     [exec] If you think configure made a mistake, make sure you are using the latest
     [exec] version from SVN.  If the latest version fails, report the problem to the
     [exec] ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
     [exec] Include the log file "config.log" produced by configure as this will help
     [exec] solving the problem.
     [exec] Could not configure library: "/home/ratna/xuggler/xuggle-xuggler/build/native/i686-pc-linux-gnu/captive/../../../../captive/ffmpeg"; you may want to try disabling it or installing your own version
     [exec] make[2]: Leaving directory `/home/ratna/xuggler/xuggle-xuggler/build/native/i686-pc-linux-gnu/captive/ffmpeg'
     [exec] make[1]: Leaving directory `/home/ratna/xuggler/xuggle-xuggler/build/native/i686-pc-linux-gnu/captive'

BUILD FAILED
/home/ratna/xuggler/xuggle-xuggler/mk/buildtools/buildhelper.xml:1146: exec 
returned: 2

still now i am not able to run ffmpeg with my 'GLIBC_2.5' 

thanks in advance 
    vijay  

Original comment by vkt...@gmail.com on 13 Jan 2011 at 12:05