Untitled

mail@pastecode.io avatar
unknown
plain_text
14 days ago
559 B
1
Indexable
Never
MediaExtractor extractor = new MediaExtractor();
extractor.setDataSource(videoPath); // Đường dẫn đến video

int trackIndex = selectTrack(extractor, "video/"); // Chọn track video
MediaFormat format = extractor.getTrackFormat(trackIndex);

int width = format.getInteger(MediaFormat.KEY_WIDTH);
int height = format.getInteger(MediaFormat.KEY_HEIGHT);
int bitRate = format.getInteger(MediaFormat.KEY_BIT_RATE);
float frameRate = format.getInteger(MediaFormat.KEY_FRAME_RATE);
int iFrameInterval = format.getInteger(MediaFormat.KEY_I_FRAME_INTERVAL);
Leave a Comment