I am trying to wirte metadata information using mp4parser but in my code I am getting userDataBox Empty in case of video captured by android but in case of other video (I have tested with downloaded vide) it is not empty and I was added metadata successfully, my problem is for video captured by android having empty userdatabox. Can any body help me ?
moov.getBoxes(UserDataBox.class).size()
My Code is here :
File mediaStorageDir = new File(
Environment
.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM),
"MYFOLDER");
File f = new File(mediaStorageDir, "VID.mp4");
if(f.exists())
{
Toast.makeText(MainActivity.this," file found",Toast.LENGTH_SHORT).show();
}
try {
fc = new FileInputStream(f).getChannel();
// fc = new FileInputStream(f).getChannel();
isoFile = new IsoFile(fc);
String str = f.getAbsolutePath();
MovieBox moov = isoFile.getMovieBox();
// for (Box box : moov.getBoxes()) {
// System.out.println("box" + box);
// }
if(moov.getBoxes(UserDataBox.class).size()>0)
{
UserDataBox udta = moov.getBoxes(UserDataBox.class).get(0);
}else{
}