Repository metrics
- Stars
- (6,985 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
public File convertToMp4(File file) throws IOException, FrameGrabber.Exception, FrameRecorder.Exception { FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(file); grabber.start(); FFmpegFrameRecorder recorder = new FFmpegFrameRecorder(file, 0); recorder.setFormat("mp4"); recorder.setFrameRate(grabber.getFrameRate()); recorder.setSampleRate(grabber.getSampleRate()); recorder.setVideoCodec(grabber.getVideoCodec()); recorder.setAudioCodec(grabber.getAudioCodec()); recorder.start(); Frame frame; while ((frame = grabber.grabFrame()) != null) { recorder.record(frame); } recorder.stop(); recorder.release(); grabber.stop(); grabber.release();
} guys, please tell me what I'm doing wrong, I'm trying to convert these files to mp4 format, point to the errors, the user from the web application will convert his video file to mp4.