Open enesb08 opened 4 years ago
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 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'
But this library implementation 'com.writingminds:FFmpegAndroid:0.3.2' is not 64 bit architecture supported. Did you implement any change for same
@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.
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?
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}; }
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?
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();
}`
@enes08 enes08What version of ffmpeg you have used? Because I am getting error with same command.
@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'
After the video compres taken on the Samsung device video showing black and not play.