Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FileNotFoundException when transforming the video

See original GitHub issue

I am getting the following error /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 /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:open
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

izzytwoshedscommented, Mar 30, 2022

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 "" } }

izzytwoshedscommented, Mar 25, 2022

There is a PR in flight, that should help. We already use FileDescriptor in MediaMuxerTarget but it was not exposed via transform method. It is now: Let me know if this solves your issue.

Read more comments on GitHub >

github_iconTop 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 > – How to solve File Not Found ...
Interested in learning more about FileNotFoundException ? Then check out our detailed video on how to solve FileNotFoundException ...
Read more >
In this tutorial, we will discuss how to solve the – FileNotFoundException in Java. This exception is thrown ...
Read more > 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 - 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found