i have video file in the sdcard. i want to encode the video file at minute 3 to 5. what im trying to say is,
let say, the complete video file is 10 minute. now i need to retrieve the video data at 3 to 5 minutes of the video to be encode and do the next process.
i have done it before but only encoded the complete video file and i dont have any idea to encoded the video file at specific time of the video. please help with this. Below is my encoded complete video file code:
public void loadVideo(){
//convert whole file into byte
File file = new File("/sdcard/videooutput.mp4");
byte[] fileData = new byte[(int) file.length()];
FileInputStream in;
try {
in = new FileInputStream(file);
try {
in.read(fileData);
for(int readNum; (readNum = in.read(fileData)) != -1;){
}
} catch (IOException e) {
Toast.makeText(this, "IO exc READ file", 2500).show();
e.printStackTrace();
}
try {
in.close();
} catch (IOException e) {
Toast.makeText(this, "IO exc CLOSE file", 2500).show();
e.printStackTrace();
}
String encoded = Base64.encodeToString(fileData, Base64.DEFAULT);
hantar(encoded);
} catch (FileNotFoundException e) {
Toast.makeText(this, "FILE NOT FOUND", 2500).show();
e.printStackTrace();
}
Please guide me with this. Thanks for advance.