a-schild / jave2

The JAVE (Java Audio Video Encoder) library is Java wrapper on the ffmpeg project
GNU General Public License v3.0
1.2k stars 245 forks source link

Could not find ffmpeg platform executable in resources for <ws/schild/jave/nativebin/ffmpeg-amd64> #214

Closed SophiaCup closed 1 year ago

SophiaCup commented 1 year ago

my java jdk version is 11. service deploy on docker,linux_x64 jave2 version is 3.3.1

error message:

03:28:52.409 [http-nio-9300-exec-10] ERROR w.s.j.p.f.DefaultFFMPEGLocator - [copyFile,160] - Could not find ffmpeg platform executable in resources for <ws/schild/jave/nativebin/ffmpeg-amd64>
,   at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85)
,03:31:43.833 [http-nio-9300-exec-10] ERROR w.s.j.p.f.DefaultFFMPEGLocator - [copyFile,160] - Could not find ffmpeg platform executable in resources for <ws/schild/jave/nativebin/ffmpeg-amd64>
,03:31:47.770 [http-nio-9300-exec-2] ERROR w.s.j.p.f.DefaultFFMPEGLocator - [<init>,103] - ffmpeg executable NOT found: /tmp/jave/ffmpeg-amd64-3.3.1
,03:31:47.771 [http-nio-9300-exec-2] ERROR w.s.j.p.f.DefaultFFMPEGLocator - [copyFile,160] - Could not find ffmpeg platform executable in resources for <ws/schild/jave/nativebin/ffmpeg-amd64>
,03:31:47.773 [http-nio-9300-exec-2] ERROR w.s.j.p.f.DefaultFFMPEGLocator - [<init>,103] - ffmpeg executable NOT found: /tmp/jave/ffmpeg-amd64-3.3.1
,03:31:47.769 [http-nio-9300-exec-2] ERROR w.s.j.p.f.DefaultFFMPEGLocator - [copyFile,160] - Could not find ffmpeg platform executable in resources for <ws/schild/jave/nativebin/ffmpeg-amd64>

error code:

//Set Audio Attributes
            AudioAttributes audio = new AudioAttributes();
            audio.setCodec("pcm_s16le");
            audio.setChannels(2);
            audio.setSamplingRate(44100);

            //Set encoding attributes
            EncodingAttributes attributes = new EncodingAttributes();
            attributes.setOutputFormat("wav");
            attributes.setAudioAttributes(audio);

            //Encode
            if (encoder == null) {
                encoder = new Encoder();
            }
            encoder.encode(new MultimediaObject(sourceFile), destinationFile, attributes, null);

pom.xml has dependecy:

<dependency>
            <groupId>ws.schild</groupId>
            <artifactId>jave-nativebin-linux-arm64</artifactId>
            <version>3.3.1</version>
        </dependency>
        <dependency>
            <groupId>ws.schild</groupId>
            <artifactId>jave-core</artifactId>
            <version>3.3.1</version>
        </dependency>
a-schild commented 1 year ago

As the message tells you, it can't find the amd64 executable. In the dependencies you did include the arm64 artifact.

You must include the jave-nativebin-linux64 artifact, not the arm64 one.

SophiaCup commented 1 year ago

oh!I see the arm as amd!!!!thx

ds-minstrel commented 8 months ago

ok,i met the same problem,so i think the keypoint is the way of running by jar cant get the correct resource, so i cp the linux-amd64 to the /tmp/jave when the docker image built... so skip the copyFile method, it is correctly way .