Comments (33)
Latest git downloaded and built.
This does not work
recorder.setVideoCodec(avcodec.AV_CODEC_ID_HEVC);
But this appears to. Very odd.
recorder.setVideoCodecName("H265");
from javacv.
We would have to compile x265 and link it to FFmpeg. Would you be interested in working on this? It would require modifying the cppbuild.sh
script as appropriate.
from javacv.
I'm interested in working on this but I'm afraid I have moderate experience in this. I remember when you compiled x264 and ffmpeg :). I'll try and see what I can do
from javacv.
Great! Let me know if you run into any problems
from javacv.
I've put the x265 files in the correct Android NDK arch-arm folders. I'm currently trying to compile ffmpeg to make the .so files. I'm using ffmpeg 2.2.9. It takes around 15 mins to compile but I don't think it's working correctly as it says the folders/commands aren't found :/.
This is my build script
#!/bin/bash
NDK=~/Downloads/android-ndk-r10c
SYSROOT=$NDK/platforms/android-8/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64
function build_one
{
./configure
--prefix=$PREFIX
--enable-shared
--disable-static
--disable-doc
--disable-ffmpeg
--disable-ffplay
--disable-ffprobe
--disable-ffserver
--disable-avdevice
--disable-doc
--disable-symver
--cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi-
--target-os=linux
--arch=arm
--enable-cross-compile
--sysroot=$SYSROOT
--extra-cflags="-Os -fpic $ADDI_CFLAGS"
--extra-ldflags="$ADDI_LDFLAGS"
$ADDITIONAL_CONFIGURE_FLAG
make clean
make
make install
}
CPU=arm
PREFIX=$(pwd)/android/$CPU
ADDI_CFLAGS="-marm"
build_one
from javacv.
Try to use the ffmpeg/cppbuild.sh
script instead...
from javacv.
I've used the cppbuild.sh script and that created the native libraries within the cppbuild/android-arm folder. Now I'm trying to run mvn install --projects ffmpeg
but that's saying Failed to execute JavaCPP Builder: could not parse "libavutil/avutil.h": file does not exist. I'm using Maven 2.2.1. The files do exist in various folder within cppbuild/android-arm/
from javacv.
Does it do the same with the source code from the develop
branches?
from javacv.
Well develop branch gives the following:
[WARNING] The POM for org.bytedeco:javacpp:jar:0.9.1-SNAPSHOT is missing, no dependency information available
[ERROR] Plugin org.bytedeco:javacpp:0.9.1-SNAPSHOT or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.bytedeco:javacpp:jar:0.9.1-SNAPSHOT: Could not find artifact org.bytedeco:javacpp:pom:0.9.1-SNAPSHOT -> [Help 1]
Changing the version in the pom file to simply '0.9' gives the same could not parse message
from javacv.
That means you also need to install the develop
branch of javacpp
:
https://github.com/bytedeco/javacpp/tree/develop
from javacv.
Ok, I get the same could not parse error.
from javacv.
Well, it works here. Can you let me know the exact sequence of git
, cppbuild.sh
and mvn
that you are using, just to make sure that there isn't anything wrong there? Thanks!
from javacv.
Alright here's what I'm doing:
cd ~/Downloads
git clone https://github.com/bytedeco/javacpp
cd ~/Downloads/javacpp
git branch -a
git checkout develop
mvn install
cd ~/Downloads
git clone https://github.com/bytedeco/javacpp-presets
cd ~/Downloads/javacpp-presets
git branch -a
git checkout develop
ANDROID_NDK=~/Downloads/android-ndk-r10c/ bash cppbuild.sh -platform android-arm install clean ffmpeg
mvn install -Dplatform.name=android-arm --projects ffmpeg
I actually cppbuilded all projects, not just ffmpeg. Here is where the could not parse error is shown.
Failed to execute goal.bytedeco:javacpp:0.9.1-SNAPSHOT:build (generate source) on project ffmpeg: Failed to execute JavaCPP Builder: Could not parse "libavutil/avutil.h": File does not exist -> [Help 1]
If I try a maven install on opencv I get a similar error:
Failed to execute goal.bytedeco:javacpp:0.9.1-SNAPSHOT:build (generate source) on project opencv: Failed to execute JavaCPP Builder: Could not parse "opencv2/core/types_c.h": File does not exist -> [Help 1]
Thanks
from javacv.
Running cppbuild.sh
with both install
and clean
isn't going to actually do anything... We should probably have the script output an error there.
And you'll need to specify the directory of the NDK for the mvn
command as well. So something like this should work:
export ANDROID_NDK=~/Downloads/android-ndk-r10c/
bash cppbuild.sh -platform android-arm install ffmpeg
mvn install -Pandroid-arm -Dplatform.root=$ANDROID_NDK --projects ffmpeg
from javacv.
Thanks, that's fixed but now later on in the build process I'm getting this error but the file does exist.
[ERROR] Failed to execute goal org.bytedeco:javacpp:0.9.1-SNAPSHOT:build (process-classes) on project ffmpeg: Failed to execute JavaCPP Builder: Cannot run program "toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++": error=2, No such file or directory -> [Help 1]
from javacv.
What's the command you used for mvn
? It sounds like the platform.root
property isn't set.
from javacv.
I managed to get past that by setting -Dplatform.compiler=/path/to/arm-linux-androideabi-g++
Note it had to be the full path, i.e. '/home/pete/Downloads/...' and not '~/Downloads/...'
Next error... :(
/home/pete/Downloads/javacpp-presets/ffmpeg/target/classes/org/bytedeco/javacpp/jniavcodec.cpp:27:17: fatal error: jni.h: No such file or directory compilation terminated.
It seems to be looking at the cppbuild/android-arm/include/
folder for jni.h ? Well there's the java-jdk jni.h or the same file in android-ndk-r10c/platforms/android-8/arch-arm/usr/include
. If I copy all the files and folders from the android include folder then it gets caught on #include <exception>
and the presumably #include <new>
from javacv.
As explained above, we need to specify the platform.root
property. In your case, something like this should also work:
mvn install -Pandroid-arm -Dplatform.root=/home/pete/Downloads/android-ndk-r10c/ --projects ffmpeg
from javacv.
FYI, work started for x265 support here: bytedeco/javacpp-presets@778d34b
from javacv.
Thanks Sam, I started work on this too but lost track. I'll try and have a look again.
from javacv.
x265 is now included in version 0.11. Thanks for your effort, it helped a lot!! Let me know if you see anything wrong with the current build.
from javacv.
Hi Sam,
Just compiled latest version 0.11 and when calling recorder.setVideoCodec(org.bytedeco.javacpp.avcodec.AV_CODEC_ID_HEVC);
I get the dreaded org.bytedeco.javacv.FrameRecorder$Exception: avcodec_open2() error -22: Could not open video codec.
I'm having a look into it.
from javacv.
Ok, thanks! Let me know what you find out.
from javacv.
Hi Peter, did you find the solution. I am facing the same issue. I am using version 0.11 on Nexus 5 with lollipop.
from javacv.
Could you guys try on Linux or Mac OS X and let me know if it works or not? It would help, thanks
from javacv.
I dont have access to any Macs, I will try on Linux and let you know.
from javacv.
I didn't find a solution but the codecs (encoder & decoder) were definitely there. But it still would not load.
I'm away at the moment but didn't try on Linux. Only android.
from javacv.
I tried on Linux (ubuntu 14.04 LTS). I converted a h264 video to HEVC using FFmpegFrameGrabber and FFmpegFrameRecorder and it works.
from javacv.
from javacv.
A bit of strangeness is remaining.
As android considered as a flavor of UNIX.
Let me check it out on Mac.
On Jun 24, 2015 5:36 AM, "Samuel Audet" [email protected] wrote:
So it works on Linux, but not on Android? Strange...
—
Reply to this email directly or view it on GitHub
#41 (comment).
from javacv.
Does the same thing happen with FFmpeg 2.7 and x265 1.7 recently updated in the presets?
from javacv.
from javacv.
Is HEVC encoder supported?
from javacv.
Related Issues (20)
- Could not get pixel format for color format 'bgra' range 'unknown'. HOT 9
- UnsatisfiedLinkError due to missing jniavutil in java.library.path HOT 3
- grabbing frames only in each second HOT 9
- javacv 1.5.10 java.lang.NoClassDefFoundError: Could not initialize class org.bytedeco.ffmpeg.global.avutil HOT 7
- javacv1.5.9 can't. use.FFmpegFrameGrabber FFmpegFrameRecorder pull push OBS H265 stream ? HOT 3
- Low video quality from HOT 1
- use recordSamples end with->Process finished with exit code 134 (interrupted by signal 6:SIGABRT) HOT 1
- use recordSamples end with->Process finished with exit code 134 (interrupted by signal 6:SIGABRT)
- RTSP stream stops after 30 secods when using TCP HOT 3
- FFmpegFrameRecorder how to record each frame from RTMP streams of dynamic frames HOT 1
- Passing OpenCV Mat as Tensorflow input HOT 2
- Raspberry Pi 5 with modern video stack and PiCamera HOT 4
- RTSP video is distorted with FFmpegFrameGrabber
- Doubts about usage of PointerScope HOT 7
- Linux environment: java.lang.NoClassDefFoundError: Could not initialize class org.bytedeco.ffmpeg.global.avutil HOT 4
- a
- FFMPEGFrameGrabber.start() doesn't find stream most of the time and blocks the thread it's running in from running its course HOT 3
- how can i use JavaCV 1.5.9 and ffmpeg 6.1.1? HOT 2
- how to set connect timeout, for grabber.start() is blocked HOT 2
- FFmpegFrameGrabber HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javacv.