Comments (10)
You could use AWS S3 or Firebase storage. then, use the result url as per your case.
new Thread(new Runnable() {
@Override
public void run() {
CognitoCachingCredentialsProvider provider = new CognitoCachingCredentialsProvider(
context,
"your key",
Regions.US_WEST_2
);
amazonS3Client = new AmazonS3Client(provider);
String bucket = "your-bucket-name";
String fileName = currentTime + "/" + currentTime + "." +
Utils.getFileExtension(context, selectedVideoUri);
PutObjectRequest putRequest = new PutObjectRequest(
bucket, fileName, new File(videoFilePath));
putRequest.setCannedAcl(CannedAccessControlList.PublicRead);
amazonS3Client.putObject(putRequest);
String uploadedUrl=amazonS3Client.getUrl(bucket, fileName).toString()
}
}).start();
Firebase storage
private void uploadVideoToStorage(SStorageReference secondFolder, tring currentTime) {
StorageReference mStorageRef;
mStorageRef = FirebaseStorage.getInstance().getReference("updates");
StorageReference secondFolder = mStorageRef.child(currentTime);
final StorageReference videoRef = secondFolder.child(currentTime + "." +
"mp4");
LogMessage.v(currentTime + Utils.getFileExtension(context, selectedVideoUri));
LogMessage.v("selectedVideoUri22::"+selectedVideoUri);
UploadTask uploadTask = videoRef.putFile(Uri.fromFile(new File(String.valueOf(selectedVideoUri))));
uploadTask.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
videoRef.getDownloadUrl().addOnCompleteListener(new OnCompleteListener<Uri>() {
@Override
public void onComplete(@NonNull Task<Uri> task) {
Toast.makeText(context, "Video uploaded", Toast.LENGTH_SHORT).show();
String uploadedUrl = task.getResult().toString();
Log.d("TAG", "UploadedVideo::" + uploadedUrl);
}
});
}
}).addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {
@Override
public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {
Log.d("TAG", "" + progress);
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Toast.makeText(context, e.getMessage(), Toast.LENGTH_SHORT).show();
}
});
}
from android-video-trimmer.
Thanks a lot Gowtham for the support.
I hope you miss the query am putting, is there any way to add audio file to trimmed video.
Please share me the thoughts on this.
from android-video-trimmer.
No, we can't add audio to the video using this library. You can use the FFmpeg library to achieve it.
from android-video-trimmer.
from android-video-trimmer.
Yes, programmatically you can do it easily using ffmpeg commands. when it comes to handling the audio part by UI like video editing apps it might take some time.
from android-video-trimmer.
from android-video-trimmer.
yes @Narendrakumar-Vanamala , This library can be only used for video trimming with compression. otherwise, u have to use ffmpeg to create custom video processing
from android-video-trimmer.
from android-video-trimmer.
@Narendrakumar-Vanamala that will work.
from android-video-trimmer.
from android-video-trimmer.
Related Issues (20)
- import com.gowtham.library.utils.TrimVideo HOT 1
- Show message "Storage permission denied" on android 13 and 14 HOT 4
- Not support permission "android.permission.READ_MEDIA_VISUAL_USER_SELECTED" on android 14 HOT 2
- Question about set timer HOT 2
- Compression after trimming mp4
- Trimmer but for Audio? HOT 1
- Class not found when unmarshalling: com.gowtham.library.utils.TrimVideoOptions HOT 4
- Linking error when adding the library HOT 2
- app size is 45 MB HOT 1
- Crash on all android version HOT 2
- Fatal Exception: java.lang.IllegalArgumentException HOT 1
- HOW TO USE THIS LIB WITHOUT PICKING VIDEO FROM GALLERY HOT 2
- I am suresh, while I taken video from internalstorage video and start to edit but getting crash.please help me HOT 9
- Minor issue, facing error if video file name contains '?' or '#' HOT 1
- How do we set the output destination?
- android 13 cant trim video permission denied.WRITE_EXTERNAL_SORAGE -> READ_EXTERNAL_VIDEO HOT 7
- allow setDestination to Cache directory HOT 2
- protocol not found. "failed to trim" HOT 5
- Not able to see the video in Chrome web browser after trimming. HOT 5
- minify enabled app crashes HOT 6
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 android-video-trimmer.