question-mark
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 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:open
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
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 "https://oss.sonatype.org/content/repositories/snapshots/" } }

1reaction
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: https://github.com/linkedin/LiTr/pull/182 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 >
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 >

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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found