Comments (8)
I fixed it on the development
branch.
from ffmpeg-kit.
I tested your code using test applications under the ffmpeg-kit-test repository but didn't get any errors. I suggest doing the same and testing your issue with them. There is an SAF
tab inside those apps. You can modify and use it to reproduce this issue.
from ffmpeg-kit.
Have you tried with an image?
When I try to create a video it works without an error using the following code:
String filePrefix = "video";
String fileExtn = ".mp4";
ContentValues contentValues = new ContentValues();
contentValues.put(MediaStore.Images.Media.RELATIVE_PATH, "Movies/Test");
contentValues.put(MediaStore.Images.Media.DISPLAY_NAME, filePrefix + fileExtn);
contentValues.put(MediaStore.Images.Media.MIME_TYPE, "video/mp4");
outUri = requireContext().getContentResolver().insert(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, contentValues);
With the following code to create an image I'm able to reproduce the Could not open file
error in your SAF Test application:
String filePrefix = "image";
String fileExtn = ".jpeg";
ContentValues contentValues = new ContentValues();
contentValues.put(MediaStore.Images.Media.RELATIVE_PATH, "Pictures/Test");
contentValues.put(MediaStore.Images.Media.DISPLAY_NAME, filePrefix + fileExtn);
contentValues.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg");
outUri = requireContext().getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, contentValues);
I was using the following ffmpeg command for testing the video and image code. In the video case it works.
final String ffmpegCommand = "-i " + image1File.getAbsolutePath() + " -i " + image2File.getAbsolutePath() + " -filter_complex \"[0]transpose=1[a]; [1]scale=100:100[2]; [a][2]overlay=300:300[b]; " +
"[b]drawtext=fontfile=/system/fonts/DroidSans.ttf: text='Text': fontcolor=black: fontsize=100: x=100: y=90: box=1: [email protected]: boxborderw=20:\" -qscale:v 0 " + videoPath;
from ffmpeg-kit.
It seems like this case is not handled by the SAF
support implemented in ffmpeg-kit
. As far as I understand, your command uses image2
muxer to encode the output jpeg file. But, image2
muxer doesn't know how to open those SAF urls. That's why your command fails.
SAF
wrapper approach taken by ffmpeg-kit
covers most of the cases. But it doesn't cover this one. And, it is not easy to use the same approach to handle your case. Because image2
muxer is an ffmpeg
module. And, modifying its behaviour means modifying ffmpeg
source code. Which is something we avoid.
We need to revisit the design of SAF
support in ffmpeg-kit
to handle this case.
from ffmpeg-kit.
Ok thanks. Interesting that the same command works in the video case but not in the image case. So there is no other (SAF compatible) way to overlay 2 images than this command?
from ffmpeg-kit.
Most probably no. But I'm not % 100 sure.
from ffmpeg-kit.
@tanersener Is this issue fixed?
from ffmpeg-kit.
Fixed in v4.5
release.
from ffmpeg-kit.
Related Issues (20)
- React-Native/Expo | Cannot use libx265 HOT 4
- [EXPO] How to use --speed flag? HOT 1
- No such filter: 'transpose=2' HOT 4
- [Android] - [Question] Create video from in memory images? HOT 1
- get some error while merging audio with image HOT 1
- Add clearCompletedSessions please:
- MissingPluginException(No implementation found for method getLogLevel on channel flutter.arthenica.com/ffmpeg_kit) package:flutter/src/services/platform_channel.dart 332:7 MethodChannel._invokeMethod HOT 9
- Is there any way to pause and resume the conversion process? HOT 4
- configureCodec returning error -61
- Android No match for targetSdk 34
- Can not set libx264 encoder Settings will report error other encoders no problem HOT 1
- Feature Request: Support --speed flag in ffmpeg_kit_flutter
- Draw Text HOT 1
- Android | Thumbnail generation for HLS video stream
- Apple | Not able to build project
- Are there any plans to adapt to HarmonyOS?
- Flutter License Compliance
- FFmpegKit initialization throws error: FFmpegKit failed to start on brand: HOT 3
- FFMpeg subtitles Korean language Garbled code,Unable to find supported fonts
- Remove x86 and x86_64 from .apk file HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ffmpeg-kit.