FileNotFoundException when transforming the video
See original GitHub issueI am getting the following error
java.io.FileNotFoundException: /storage/emulated/0/Movies/MyApp/video.mp4: open failed: EEXIST (File exists)
This happens while using the below api specifically on Android Devices above Android 10. It works fine below Android 10.
MediaTransformer.transform(@NonNull String requestId,
Uri inputUri,
String outputFilePath,
MediaFormat targetVideoFormat,
MediaFormat targetAudioFormat,
TransformationListener listener,
TransformationOptions transformationOptions)
Inside the above api MediaTargetException is thrown
com.linkedin.android.litr.exception.MediaTargetException: java.io.FileNotFoundException: /storage/emulated/0/Movies/MyApp/video.mp4: open failed: EEXIST (File exists)Media transformation failed for job id: null
Failed to open the media target for write.
Output file path or Uri encoded string: /storage/emulated/0/Movies/MyApp/video.mp4
MediaMuxer output format: 0
I believe this might have to do with the new File system changes introduced from Android 10
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Android: File not found exception while uploading a video
It's showing error because you are not converting the content path into real path. It works for me. Hope it helps. Share. Share...
Read more >java.io.FileNotFoundException – How to solve File Not Found ...
Interested in learning more about FileNotFoundException ? Then check out our detailed video on how to solve java.io. FileNotFoundException ...
Read more >Solving java.io.FileNotFoundException
In this tutorial, we will discuss how to solve the java.io.FileNotFoundException – FileNotFoundException in Java. This exception is thrown ...
Read more >java.io.FileNotFoundException in Java - GeeksforGeeks
Read; Discuss; Courses; Practice; Video ... FileNotFoundException which is a common exception which occurs while we try to access a file.
Read more >How to Fix the FileNotFoundException in Java.io - Rollbar
FileNotFoundException is a checked exception in Java that occurs when an attempt to open a file denoted by a specified pathname fails.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes. We are preparing a new release. Meanwhile, you can try a snapshot release by adding following to your gradle build files (I didn’t try it myself yet):
repositories { maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } }
There is a PR in flight, that should help. We already use
FileDescriptor
inMediaMuxerTarget
but it was not exposed viatransform
method. It is now: https://github.com/linkedin/LiTr/pull/182 Let me know if this solves your issue.