GithubHelp home page GithubHelp logo

Comments (6)

unoegohh avatar unoegohh commented on May 20, 2024 1

Hmm it is strange cause if i use

import {Video as VideoCompressor} from 'react-native-compressor';

VideoCompressor.compress(file.path, {
        compressionMethod: 'auto',
        minimumFileSizeForCompress: 5,
        maxSize: 1000,
      })
        .then(res => {
          console.log('video', res);
        })
        .catch(console.log);

and then i get

video1 file:///Users/unoegohh/Library/Developer/CoreSimulator/Devices/C856B11B-463E-48F6-9396-5F4E0838CDC2/data/Containers/Data/Application/60489947-00AB-49D1-A5F0-E72164EDD6D5/tmp/react-native-image-crop-picker/F6B9FBB8-4C2A-4882-ABBC-A3E9BFE8A0C7.mp4

and it is still get 320x564 video

file

UPD - i got my error) i was using ImagePicker.openPicker before compression and it returned already compressed video
)) ty! as always i need to find error on my side first then write an issue)

from react-native-compressor.

numandev1 avatar numandev1 commented on May 20, 2024

@unoegohh let me see it

from react-native-compressor.

numandev1 avatar numandev1 commented on May 20, 2024

@unoegohh are you want manual compression or auto compression-like WhatsApp?

from react-native-compressor.

numandev1 avatar numandev1 commented on May 20, 2024

@unoegohh if I use maxSize: 1000 then I am getting 562x1000 resolution of the video which you have attached

const dstUrl = await Video.compress(
      sourceVideo,
      {
        compressionMethod: 'auto',
        minimumFileSizeForCompress: 5,
        maxSize: 1000,
      },
      (progress) => {
        if (backgroundMode) {
          console.log('Compression Progress: ', progress);
        } else {
          setCompressingProgress(progress);
        }
      }
    );

from react-native-compressor.

numandev1 avatar numandev1 commented on May 20, 2024

@unoegohh yes react-native-image-crop-picker =>. openPicker is compressing video by reducing video height and width. can you put your video file into tmp directory and add a path directly to test VideoCompressor.compress("file:///...../tmp/filename.mp4"

from react-native-compressor.

numandev1 avatar numandev1 commented on May 20, 2024

I think it is already fixed. feel free to reopen if you see this problem again. thanks.

from react-native-compressor.

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.