wseemann / FFmpegMediaMetadataRetriever

FFmpegMediaMetadataRetriever provides a unified interface for retrieving frame and meta data from an input media file.
1.73k stars 387 forks source link

How to get Current Time/Bitmap from RTSP url #171

Open sharmad1205 opened 6 years ago

sharmad1205 commented 6 years ago

The code below needs the time i.e here 2000000 Bitmap b = mmr.getFrameAtTime(2000000, FFmpegMediaMetadataRetriever.OPTION_CLOSEST); // frame at 2 seconds

Actually I am receiving the RTSP from the IP Camera and needs to capture the current frame. How can I get the current time form the RTSP without using any mediaplayer/videoview

DimitarStoyanoff commented 6 years ago

@sharmad1205 You can use a Calendar.getInstance().getTimeInMillis() when you start downloading and then subtract it from the next current time, which will give you the difference in time you need in the getFrameAtTime method.