Giter VIP home page Giter VIP logo

Comments (10)

a914-gowtham avatar a914-gowtham commented on May 25, 2024

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.

Narendrakumar-Vanamala avatar Narendrakumar-Vanamala commented on May 25, 2024

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.

a914-gowtham avatar a914-gowtham commented on May 25, 2024

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.

Narendrakumar-Vanamala avatar Narendrakumar-Vanamala commented on May 25, 2024

from android-video-trimmer.

a914-gowtham avatar a914-gowtham commented on May 25, 2024

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.

FFmpeg-kit
FFmpeg

from android-video-trimmer.

Narendrakumar-Vanamala avatar Narendrakumar-Vanamala commented on May 25, 2024

from android-video-trimmer.

a914-gowtham avatar a914-gowtham commented on May 25, 2024

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.

Narendrakumar-Vanamala avatar Narendrakumar-Vanamala commented on May 25, 2024

from android-video-trimmer.

a914-gowtham avatar a914-gowtham commented on May 25, 2024

@Narendrakumar-Vanamala that will work.

from android-video-trimmer.

Narendrakumar-Vanamala avatar Narendrakumar-Vanamala commented on May 25, 2024

from android-video-trimmer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.