Giter Site home page Giter Site logo

Comments (33)

pgfsim avatar pgfsim commented on May 21, 2024 1

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.

saudet avatar saudet commented on May 21, 2024

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.

pgfsim avatar pgfsim commented on May 21, 2024

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.

saudet avatar saudet commented on May 21, 2024

Great! Let me know if you run into any problems

from javacv.

pgfsim avatar pgfsim commented on May 21, 2024

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.

saudet avatar saudet commented on May 21, 2024

Try to use the ffmpeg/cppbuild.sh script instead...

from javacv.

pgfsim avatar pgfsim commented on May 21, 2024

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.

saudet avatar saudet commented on May 21, 2024

Does it do the same with the source code from the develop branches?

from javacv.

pgfsim avatar pgfsim commented on May 21, 2024

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.

saudet avatar saudet commented on May 21, 2024

That means you also need to install the develop branch of javacpp:
https://github.com/bytedeco/javacpp/tree/develop

from javacv.

pgfsim avatar pgfsim commented on May 21, 2024

Ok, I get the same could not parse error.

from javacv.

saudet avatar saudet commented on May 21, 2024

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.

pgfsim avatar pgfsim commented on May 21, 2024

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.

saudet avatar saudet commented on May 21, 2024

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.

pgfsim avatar pgfsim commented on May 21, 2024

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.

saudet avatar saudet commented on May 21, 2024

What's the command you used for mvn? It sounds like the platform.root property isn't set.

from javacv.

pgfsim avatar pgfsim commented on May 21, 2024

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.

saudet avatar saudet commented on May 21, 2024

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.

saudet avatar saudet commented on May 21, 2024

FYI, work started for x265 support here: bytedeco/javacpp-presets@778d34b

from javacv.

pgfsim avatar pgfsim commented on May 21, 2024

Thanks Sam, I started work on this too but lost track. I'll try and have a look again.

from javacv.

saudet avatar saudet commented on May 21, 2024

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.

pgfsim avatar pgfsim commented on May 21, 2024

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.

saudet avatar saudet commented on May 21, 2024

Ok, thanks! Let me know what you find out.

from javacv.

godzillad avatar godzillad commented on May 21, 2024

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.

saudet avatar saudet commented on May 21, 2024

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.

godzillad avatar godzillad commented on May 21, 2024

I dont have access to any Macs, I will try on Linux and let you know.

from javacv.

pgfsim avatar pgfsim commented on May 21, 2024

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.

godzillad avatar godzillad commented on May 21, 2024

I tried on Linux (ubuntu 14.04 LTS). I converted a h264 video to HEVC using FFmpegFrameGrabber and FFmpegFrameRecorder and it works.

from javacv.

saudet avatar saudet commented on May 21, 2024

from javacv.

ShihabSoft avatar ShihabSoft commented on May 21, 2024

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.

saudet avatar saudet commented on May 21, 2024

Does the same thing happen with FFmpeg 2.7 and x265 1.7 recently updated in the presets?

from javacv.

saudet avatar saudet commented on May 21, 2024

from javacv.

gordonpro avatar gordonpro commented on May 21, 2024

Is HEVC encoder supported?

from javacv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.