Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mp4parser version conflict (compressed video has no sound)

I am using these two libraries in my project:

https://github.com/HemendraGangwar/VideoTrimmingLikeWhatsapp https://github.com/fishwjy/VideoCompressor

Both libraries are imported locally to my project (i.e. copied them and added them to the project)

Both libraries work fine when used separately, but when I use them together I get some errors of type Program type already present which I solved by deleting the file isoparser-1.0.6.jar from the second library, because I noticed that the two libraries use the same library 'com.googlecode.mp4parser:isoparser' but with different versions: 1.1.21 for the first one and 1.0.6 for the second one.

When using only the old library, I get this code:

error: cannot find symbol class FileDataSourceViaHeapImpl

It is working now, but the problem the output video (after compression) does not have sound on it. How can I solve this?

Here is the code I am using for compressing the video (after trimming):

VideoController.getInstance().convertVideo(tmpFile.toString(), dstFile.toString(),
           VideoController.COMPRESS_QUALITY_MEDIUM, null);

EDIT1

Summering the scenarios here with the same video:

VideoTrimmingLikeWhatsapp with verion 1.1.21 => works

VideoTrimmingLikeWhatsapp with verion 1.0.6 => does not works (compile error of missing classes)

VideoCompressor with 1.1.21 => does not work (no sound)

VideoCompressor with 1.0.6 => work

I tried a lot of things, and I am loosing tracks here. I also tried using SiliCompressor which seems also using version 1.0.6 of mp4isoparser, and the same problem is happening, output video has no sound. I posted an issue here a few days ago, but I don't think they will address this any time soon.

I also submitted here.

I tried downloading the mp4parser version 1.1.21 from here, and tried to import it locally so I can change the package names, but I couldn't because it using Maven not Gradle. The old version is a jar file, and I need to decompile it so I can mess with it. Can I do that?

I also tried using ffmpeg libraries, but all of them work very slowly compared to mp4isoparser

EDIT 2

The author of SiliCompressor has replied to the here I opened, he says that the problem should be solved by now. For the moment I am unable to verify it, as I no longer work on that project. If any one can confirm it, just tell me to add the answer to this topic.

like image 640
hiddeneyes02 Avatar asked Jul 30 '18 13:07

hiddeneyes02


1 Answers

This combination worked for me:

implementation 'com.iceteck.silicompressorr:silicompressor:2.2.3'
implementation ('com.googlecode.mp4parser:isoparser:1.0.6') {
         exclude group: 'org.aspectj', module: 'aspectjrt' 
}

Credit to: https://github.com/AndreyAsadchy https://github.com/Tourenathan-G5organisation/SiliCompressor/issues/141#issuecomment-625308490

like image 63
Gal Rom Avatar answered Nov 12 '22 06:11

Gal Rom