Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FFmpeg build failure on Jetson tx2 (linux-arm64) #586

Closed
chichunchen opened this issue Jul 12, 2018 · 8 comments
Closed

FFmpeg build failure on Jetson tx2 (linux-arm64) #586

chichunchen opened this issue Jul 12, 2018 · 8 comments
Assignees
Labels

Comments

@chichunchen
Copy link

I'm trying to decode video on Jetson tx2 and I followed the tutorial in the paragraph of Native Compilation. The compilation for FFmpeg seems good, but after the compilation I got failure message on patching. Below is the log on TX2:

Scanning dependencies of target common
Scanning dependencies of target encoder
[  2%] Building CXX object encoder/CMakeFiles/encoder.dir/frameencoder.cpp.o
[  4%] Building CXX object encoder/CMakeFiles/encoder.dir/encoder.cpp.o
[  8%] Building CXX object encoder/CMakeFiles/encoder.dir/ratecontrol.cpp.o
[  8%] Building CXX object common/CMakeFiles/common.dir/param.cpp.o
[ 67%] Built target common
[ 69%] Building CXX object encoder/CMakeFiles/encoder.dir/api.cpp.o
[ 97%] Built target encoder
[100%] Linking CXX static library libx265.a
[100%] Built target x265-static
[ 61%] Built target common
[ 97%] Built target encoder
[100%] Built target x265-static
Install the project...
-- Install configuration: "Release"
-- Installing: /home/nvidia/workspace/javacpp-presets/ffmpeg/cppbuild/linux-arm64/lib/libx265.a
-- Up-to-date: /home/nvidia/workspace/javacpp-presets/ffmpeg/cppbuild/linux-arm64/include/x265.h
-- Up-to-date: /home/nvidia/workspace/javacpp-presets/ffmpeg/cppbuild/linux-arm64/include/x265_config.h
-- Up-to-date: /home/nvidia/workspace/javacpp-presets/ffmpeg/cppbuild/linux-arm64/lib/pkgconfig/x265.pc
patching file vp8/common/rtcd_defs.pl
Hunk #1 FAILED at 50.
Hunk #2 FAILED at 64.
2 out of 2 hunks FAILED -- saving rejects to file vp8/common/rtcd_defs.pl.rej
patching file vp8/vp8_common.mk
Hunk #1 succeeded at 141 (offset 8 lines).
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] JavaCPP Presets .................................... SUCCESS [  2.013 s]
[INFO] JavaCPP Presets for OpenCV ......................... SUCCESS [46:57 min]
[INFO] JavaCPP Presets for FFmpeg ......................... FAILURE [04:06 min]
[INFO] JavaCPP Presets for FlyCapture ..................... SKIPPED
[INFO] JavaCPP Presets for libdc1394 ...................... SKIPPED
[INFO] JavaCPP Presets for libfreenect .................... SKIPPED
[INFO] JavaCPP Presets for ARToolKitPlus .................. SKIPPED
[INFO] JavaCPP Presets for Chilitags ...................... SKIPPED
[INFO] JavaCPP Presets for flandmark ...................... SKIPPED
[INFO] JavaCPP Presets for OpenBLAS ....................... SKIPPED
[INFO] JavaCPP Presets for ARPACK-NG ...................... SKIPPED
[INFO] JavaCPP Presets for CMINPACK ....................... SKIPPED
[INFO] JavaCPP Presets for FFTW ........................... SKIPPED
[INFO] JavaCPP Presets for GSL ............................ SKIPPED
[INFO] JavaCPP Presets for Leptonica ...................... SKIPPED
[INFO] JavaCPP Presets for Tesseract ...................... SKIPPED
[INFO] JavaCPP Presets for Systems ........................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 51:08 min
[INFO] Finished at: 2018-07-12T00:09:36-04:00
[INFO] Final Memory: 42M/816M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.bytedeco:javacpp:1.4.2-SNAPSHOT:build (javacpp.cppbuild.install) on project ffmpeg: Execution javacpp.cppbuild.install of goal org.bytedeco:javacpp:1.4.2-SNAPSHOT:build failed: Process exited with an error: 1 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :ffmpeg

The actual command I typed to compile is:

$ sudo apt-get update
$ sudo apt-get install clang ant maven python swig git file wget unzip tar bzip2 gzip patch autoconf-archive automake make cmake libtool perl nasm yasm gfortran libasound2-dev freeglut3-dev libgtk2.0-dev libusb-dev zlib1g
$ git clone https://github.com/bytedeco/javacpp-presets.git
$ cd javacpp-presets
$ mvn install -Djavacpp.platform=linux-arm64 -Dmaven.javadoc.skip=true

which only change the platform in the last line from armfh to arm64.

@saudet
Copy link
Member

saudet commented Jul 12, 2018

@mjhas @Spawn32 ideas?

@mjhas
Copy link
Contributor

mjhas commented Jul 12, 2018

well the patch which is not sucessfully applied was written for VPX 1.6.1 - now the version is VPX 1.7.0. Either adapt the patch to work with 1.7.0 or remove/disable it entirely.

@saudet
Copy link
Member

saudet commented Jul 12, 2018

@mjhas Yeah, I see... Could you update it? :)

@saudet saudet added the bug label Jul 12, 2018
@yuhao
Copy link

yuhao commented Jul 13, 2018

Hi! Could we get some guidance in terms of how to disable this patch or adapt it?

@saudet
Copy link
Member

saudet commented Jul 14, 2018

I've updated the patch, please try again.

@chichunchen
Copy link
Author

chichunchen commented Jul 15, 2018

Thanks a lot! I'm now able to compile ffmpeg in javacpp-preset. However, by using the javacv installed via maven, the binary seems to be yet updated. It still give me the NoClassDefFoundError like this:

Exception in thread "Thread-0" java.lang.NoClassDefFoundError: Could not initialize class org.bytedeco.javacpp.avutil
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at org.bytedeco.javacpp.Loader.load(Loader.java:938)
	at org.bytedeco.javacpp.Loader.load(Loader.java:879)
	at org.bytedeco.javacpp.avformat$Read_packet_Pointer_BytePointer_int.<clinit>(avformat.java:632)
	at org.bytedeco.javacv.FFmpegFrameGrabber.<clinit>(FFmpegFrameGrabber.java:296)
	at VRPlayer$SVRNetworkHandler.run(VRPlayer.java:222)

Therefore, I decide to compile the whole tool chain manually (javacpp-preset, javacpp, and javacv), but while compiling javacpp, it gives me fail message:

Installing "flycapture"
~/workspace/javacpp-presets/flycapture/cppbuild ~/workspace/javacpp-presets
Please place flycapture.2.11.3.121_armhf.tar.gz in the downloads directory
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] JavaCPP Presets .................................... SUCCESS [  2.198 s]
[INFO] JavaCPP Presets for OpenCV ......................... SUCCESS [47:17 min]
[INFO] JavaCPP Presets for FFmpeg ......................... SUCCESS [09:59 min]
[INFO] JavaCPP Presets for FlyCapture ..................... FAILURE [  0.122 s]
[INFO] JavaCPP Presets for libdc1394 ...................... SKIPPED
[INFO] JavaCPP Presets for libfreenect .................... SKIPPED
[INFO] JavaCPP Presets for ARToolKitPlus .................. SKIPPED
[INFO] JavaCPP Presets for Chilitags ...................... SKIPPED
[INFO] JavaCPP Presets for flandmark ...................... SKIPPED
[INFO] JavaCPP Presets for OpenBLAS ....................... SKIPPED
[INFO] JavaCPP Presets for ARPACK-NG ...................... SKIPPED
[INFO] JavaCPP Presets for CMINPACK ....................... SKIPPED
[INFO] JavaCPP Presets for FFTW ........................... SKIPPED
[INFO] JavaCPP Presets for GSL ............................ SKIPPED
[INFO] JavaCPP Presets for Leptonica ...................... SKIPPED
[INFO] JavaCPP Presets for Tesseract ...................... SKIPPED
[INFO] JavaCPP Presets for Systems ........................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 57:22 min
[INFO] Finished at: 2018-07-14T16:09:44-04:00
[INFO] Final Memory: 45M/804M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.bytedeco:javacpp:1.4.2-SNAPSHOT:build (javacpp.cppbuild.install) on project flycapture: Execution javacpp.cppbuild.install of goal org.bytedeco:javacpp:1.4.2-SNAPSHOT:build failed: Process exited with an error: 1 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :flycapture

I actually only need ffmpeg on my tx2, but to compile javacv manually, I seems to have to compile all the module in javacpp-preset, or can I just use the jar file of ffmpeg and opencv to compile javacv?

@saudet
Copy link
Member

saudet commented Jul 15, 2018

If you only use FFmpeg, you don't need the rest, no. Please set the "org.bytedeco.javacpp.logger.debug" system property to "true" and let's see what it's trying to load. BTW, you need to make sure ffmpeg-linux-arm64.jar file is in your class path.

@saudet
Copy link
Member

saudet commented Jul 18, 2018

BTW, it would be nice to have builds for linux-arm64. If anyone would like to contribute, please go to bytedeco/javacv#1021 for some additional information, thanks!

@saudet saudet closed this as completed Jul 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants