JackZ
JackZ

Reputation: 152

Get Time when Video was Recorded (Android)

is there any way to get the a video's exact recording date in milliseconds? I use this sample code for making the video. How can I capture a video recording on Android?

Is there any way to extract that information? And I'm talking about when the video was started! Not when the file was created... Is there a way to insert the time? The generall idea is that my colleagues can use the video as well, without the need of deserialising some class where the timeinformation is stored.

Edit For example I get the video from a colleague and then want to determinate when the video was recorded.

Bye JackZ

Upvotes: 1

Views: 3943

Answers (1)

g00dy
g00dy

Reputation: 6768

Try this sample here, taken from the thread here:

    Calendar c = Calendar.getInstance();
    System.out.println("Current time => "+c.getTime());

    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    String formattedDate = df.format(c.getTime());
    // formattedDate have current date/time
    Toast.makeText(this, formattedDate, Toast.LENGTH_SHORT).show();

Also, you can check the SystemClock or you can just:

long timestamp = System.currentTimeMillis();

Call this one wherever you need and record the value.

EDIT

To extract the information from the file itself try this one and more specifically this one.

Upvotes: 1

Related Questions