Open charlieaboumoussa opened 4 years ago
I would really love if anyone shares if he/she encountered this issue.
Just wait until compression is finished and than open the video file compressed. You can see that compression file mp4 on device even if compression hasn't finished yet. That's why you see : "Failed to play video. An unknown error has occured.".
Just wait until compression is finished and than open the video file compressed. You can see that compression file mp4 on device even if compression hasn't finished yet. That's why you see : "Failed to play video. An unknown error has occured.".
I think @charlieaboumoussa is correctly using the URI in onPostExecute i.e. when the background task is completed.
I am also facing this issue but with a different video.
@maria-chris So I cannot do anything with the compressedUri until the file is compressed, or else the compression would be interrupted. Is that what you mean? Yet I am waiting for the compression to finish in onPostExecute. How can we fix this? And is there another reliable library? Thank you
@ankitbatra11 So it seems you have the same issue. How did you solve this? Thank you
Hello @ankitbatra11 I have added implementation 'com.github.ankitbatra11:VideoCompressor:1.0.3' I have the following error: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.github.ankitbatra11:VideoCompressor:1.0.3 Any suggestions?
Hello @ankitbatra11 I have added implementation 'com.github.ankitbatra11:VideoCompressor:1.0.3' I have the following error: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.github.ankitbatra11:VideoCompressor:1.0.3 Any suggestions?
You must use jitpack as one of the repos in your android project.
allprojects {
repositories {
google()
jcenter()
maven {
url "https://www.jitpack.io"
}
}
}
@ankitbatra11 Hello. It is still showing the same error. It is a hassle to implement compression on android. What to do?
@Tourenathan-G5organisation if you could help, it would be great! thank you
@ankitbatra11 Hello. It is still showing the same error. It is a hassle to implement compression on android. What to do?
Can you paste your root build.gradle
file?
I am using an Async Task:
The compressed video seems to be corrupted. It appears as a normal mp4 file, but when I click on it the device gives me a notice: "Failed to play video. An unknown error has occured.".
The original video that corresponds to mVideoUri works just fine on the device. Does it have have to do with the orignal video's audio/video codec? Can anyone help me please?
PS: I am using this library as the app's camera. https://github.com/natario1/CameraView implementation 'com.otaliastudios:cameraview:2.6.4'