SiliCompressor icon indicating copy to clipboard operation
SiliCompressor copied to clipboard

Samsung device not working

Open enesb08 opened this issue 5 years ago • 10 comments

After the video compres taken on the Samsung device video showing black and not play.

enesb08 avatar Dec 06 '19 15:12 enesb08

I am also facing this issue after this line of code: String convertedVideoFilePath = SiliCompressor.with(this).compressVideo(recordedVideoPath, getMediaDirectory()); Device screen just goes black and nothing happens with the applcation. Log prints this repeteadly: E/tmessages: Surface frame wait timed out I/MediaCodec: setCodecState state : 1 I/MediaCodec: setCodecState state : 0

I need this fix urgently please suggest.

rohitsharma181589 avatar Dec 09 '19 11:12 rohitsharma181589

I am also facing this issue after this line of code: String convertedVideoFilePath = SiliCompressor.with(this).compressVideo(recordedVideoPath, getMediaDirectory()); Device screen just goes black and nothing happens with the applcation. Log prints this repeteadly: E/tmessages: Surface frame wait timed out I/MediaCodec: setCodecState state : 1 I/MediaCodec: setCodecState state : 0

I need this fix urgently please suggest.

I dint find solition my question.I m use other library now. I m use now this library. implementation 'com.writingminds:FFmpegAndroid:0.3.2'

enesb08 avatar Dec 09 '19 12:12 enesb08

But this library implementation 'com.writingminds:FFmpegAndroid:0.3.2' is not 64 bit architecture supported. Did you implement any change for same

surabhiverma1 avatar Mar 12 '20 13:03 surabhiverma1

@surabhiverma1
I did not make any changes in the library. When I analyze the Apk, I see that it supports 64bit. It works fine now.İf you want ı can send compress command code for this library.

enesb08 avatar Mar 13 '20 08:03 enesb08

Compression using com.writingminds:FFmpegAndroid:0.3.2 is pretty slow. Is it faster for you? Can you please send your compress command if it works better?

rajugautam avatar Apr 13 '20 11:04 rajugautam

Compression using com.writingminds:FFmpegAndroid:0.3.2 is pretty slow. Is it faster for you? Can you please send your compress command if it works better?

İt is my compress command.I hope that will be useful

public static String[] getCompressCommand(String path, String newFileName,String w,String h) { return new String[]{"-y", "-i", path,"-vf", "scale='if(gt(asar,16/9),'"+w+"','"+h+"'iwsar/ih)':'if(gt(asar,16/9),'"+w+"'*ih/iw/sar,'"+h+"')',pad='"+w+"':'"+h+"':(ow-iw)/2:(oh-ih)/2,setsar=1" ,"-c:v", "libx264", "-bufsize", "3968k", "-ac", "1", "-g", "60", "-c:a", "aac", "-b:a", "128k", "-level", "3.0", "-crf", "30", "-preset", "ultrafast", "-strict", "-2", newFileName}; }

enesb08 avatar Apr 13 '20 14:04 enesb08

Compression using com.writingminds:FFmpegAndroid:0.3.2 is pretty slow. Is it faster for you? Can you please send your compress command if it works better?

İt is my compress command.I hope that will be useful

public static String[] getCompressCommand(String path, String newFileName,String w,String h) { return new String[]{"-y", "-i", path,"-vf", "scale='if(gt(a_sar,16/9),'"+w+"','"+h+"'_iw_sar/ih)':'if(gt(a_sar,16/9),'"+w+"'*ih/iw/sar,'"+h+"')',pad='"+w+"':'"+h+"':(ow-iw)/2:(oh-ih)/2,setsar=1" ,"-c:v", "libx264", "-bufsize", "3968k", "-ac", "1", "-g", "60", "-c:a", "aac", "-b:a", "128k", "-level", "3.0", "-crf", "30", "-preset", "ultrafast", "-strict", "-2", newFileName}; }

Hello, what is 'w' and 'h' is here? and what value you are using?

abkoradiya avatar Jul 25 '20 15:07 abkoradiya

Compression using com.writingminds:FFmpegAndroid:0.3.2 is pretty slow. Is it faster for you? Can you please send your compress command if it works better?

İt is my compress command.I hope that will be useful public static String[] getCompressCommand(String path, String newFileName,String w,String h) { return new String[]{"-y", "-i", path,"-vf", "scale='if(gt(a_sar,16/9),'"+w+"','"+h+"'_iw_sar/ih)':'if(gt(a_sar,16/9),'"+w+"'*ih/iw/sar,'"+h+"')',pad='"+w+"':'"+h+"':(ow-iw)/2:(oh-ih)/2,setsar=1" ,"-c:v", "libx264", "-bufsize", "3968k", "-ac", "1", "-g", "60", "-c:a", "aac", "-b:a", "128k", "-level", "3.0", "-crf", "30", "-preset", "ultrafast", "-strict", "-2", newFileName}; }

Hello, what is 'w' and 'h' is here? and what value you are using?

Hi .w and h values ​​ are Width and height of the video frame image.

`

  MediaMetadataRetriever mRetriever = new MediaMetadataRetriever();
    mRetriever.setDataSource(filePath);
    Bitmap frame = mRetriever.getFrameAtTime();
      int iw = frame.getWidth();
    int ih = frame.getHeight();

    int evenIw= (int) Math.ceil(iw/2)*2;
    int evenIh= (int) Math.ceil(ih/2)*2;

    try {
        ffmpeg.execute( Util.getCompressCommand(filePath,outPath,evenIw+"",evenIh+""), new ExecuteBinaryResponseHandler() {

            @Override
            public void onStart() {

                Log.e("VIDEO","START");

            }

            @Override
            public void onProgress(String message) {
                Log.e("VIDEO","onProgress"+message);

              

            }

            @Override
            public void onFailure(String message) {
                Log.e("VIDEO","onFailure"+message);

                
            }

            @Override
            public void onSuccess(String message) {
                Log.e("VIDEO","onSuccess"+message);

              

            }

            @Override
            public void onFinish() {
               
            }
        });
    } catch (FFmpegCommandAlreadyRunningException ex) {
        ex.printStackTrace();
    }`

enesb08 avatar Jul 25 '20 15:07 enesb08

@enes08 enes08What version of ffmpeg you have used? Because I am getting error with same command.

abkoradiya avatar Jul 25 '20 15:07 abkoradiya

@enes08 enes08What version of ffmpeg you have used? Because I am getting error with same command. @abkoradiya I used this library

implementation 'com.writingminds:FFmpegAndroid:0.3.2'

enesb08 avatar Jul 25 '20 16:07 enesb08