FileNotFoundException when transforming the video
- Dominant language
- Java
- Stars
- 663
- Forks
- 92
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
Research direction
Start at the MediaTransformer.transform API and reproduce the failure on an Android device above Android 10 using the output path shown in the report. Trace the MediaTargetException through target creation and media writing, then verify that the transformation succeeds for the reported output location without the FileNotFoundException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100