1

because of the not much supported Codecs from the Java Media Lib, i try to convert AVI and MPEG4 Files to MP4 with Xuggler and open the new File afterwards.

There is no problem to AVI Files but on MPEG4 Files i get following error:

Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: failed to encode video
    at xuggle.xuggler@5.4/com.xuggle.mediatool.MediaWriter.encodeVideo(MediaWriter.java:764)
    at xuggle.xuggler@5.4/com.xuggle.mediatool.MediaWriter.encodeVideo(MediaWriter.java:783)
    at xuggle.xuggler@5.4/com.xuggle.mediatool.MediaWriter.onVideoPicture(MediaWriter.java:1434)
    at xuggle.xuggler@5.4/com.xuggle.mediatool.AMediaToolMixin.onVideoPicture(AMediaToolMixin.java:166)
    at xuggle.xuggler@5.4/com.xuggle.mediatool.MediaReader.dispatchVideoPicture(MediaReader.java:610)
    at xuggle.xuggler@5.4/com.xuggle.mediatool.MediaReader.decodeVideo(MediaReader.java:519)
    at xuggle.xuggler@5.4/com.xuggle.mediatool.MediaReader.readPacket(MediaReader.java:475)
    at magnitudo.c_movie/de.telemotive.magnitudo.c_movie.VideoFileIO.convertUnsupportedFiles(VideoFileIO.java:71)
    at magnitudo.c_movie/de.telemotive.magnitudo.c_movie.VideoFileIO.load(VideoFileIO.java:21)
    at magnitudo.c_movie/de.telemotive.magnitudo.c_movie.VideoController.loadFile(VideoController.java:103)
    at magnitudo.c_movie/de.telemotive.magnitudo.c_movie.VideoController.displayFile(VideoController.java:79)
    at magnitudo.c_analysiscase/de.telemotive.magnitudo.c_analysiscase.AnalysisCaseController.lambda$12(AnalysisCaseController.java:232)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
    at java.base/java.lang.Thread.run(Thread.java:830)

I don't know where the problem is, my method is really simple:

private static Path convertUnsupportedFiles(Path path) {
    Path pathNew = Paths.get("C:/DEV/2020-05-15_Freitag/Video_NoName_Cam1_20200515_092350_20200515_092830/output.mp4");
    IMediaReader mR = ToolFactory.makeReader(path.toString());
    IMediaWriter mW = ToolFactory.makeWriter(pathNew.toString(), mR);

    mR.addListener(mW);

    while (mR.readPacket() == null);

    return pathNew;
}

I allready read some Post about Supported Codes and other Convert Codes but the outcome doens't change.

Did i miss understand the support to MPEG4 Files?

Kind Regards, Marvin

0 Answers0