本文整理了Java中android.media.MediaMuxer.<init>()
方法的一些代码示例,展示了MediaMuxer.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MediaMuxer.<init>()
方法的具体详情如下:
包路径:android.media.MediaMuxer
类名称:MediaMuxer
方法名:<init>
暂无
代码示例来源:origin: TeamNewPipe/NewPipe
};
muxer = new MediaMuxer(tmpFile.getAbsolutePath(), OutputFormat.MUXER_OUTPUT_MPEG_4);
代码示例来源:origin: robolectric/robolectric
int inputSize = 512;
String tempFilePath = "/tmp/" + UUID.randomUUID().toString();
MediaMuxer muxer = new MediaMuxer(tempFilePath, MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);
代码示例来源:origin: guardianproject/haven
try
mMuxer = new MediaMuxer(outputPath,
MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);
} catch (IOException ioe)
代码示例来源:origin: guoxiaoxing/phoenix
mMuxer = new MediaMuxer(outputPath, MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);
setupMetadata();
setupTrackTranscoders(formatStrategy);
代码示例来源:origin: aserbao/AndroidCamera
/**
* Creates a muxer to write the encoded frames.
*
* <p>The muxer is not started as it needs to be started only after all streams have been added.
*/
private MediaMuxer createMuxer() throws IOException {
return new MediaMuxer(mOutputPath, MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);
}
代码示例来源:origin: MasayukiSuda/GPUVideo-android
/**
* Constructor
*/
public MediaMuxerCaptureWrapper(final String filePath) throws IOException {
mediaMuxer = new MediaMuxer(filePath, MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);
encoderCount = startedCount = 0;
isStarted = false;
}
代码示例来源:origin: MasayukiSuda/CameraRecorder-android
/**
* Constructor
*/
public MediaMuxerCaptureWrapper(final String filePath) throws IOException {
mediaMuxer = new MediaMuxer(filePath, MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);
encoderCount = startedCount = 0;
isStarted = false;
}
代码示例来源:origin: saki4510t/libcommon
public MediaMuxerWrapper(final String output_path, final int format)
throws IOException {
mMuxer = new MediaMuxer(output_path, format);
}
代码示例来源:origin: dingjikerbo/Android-RTSP
public AndroidMuxer(String outputPath) {
try {
mMuxer = new MediaMuxer(outputPath, MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);
} catch (IOException e) {
e.printStackTrace();
}
}
代码示例来源:origin: aserbao/AndroidCamera
public void initMediaMux(String outputVideoPath){
try {
mediaMuxer = new MediaMuxer(outputVideoPath, MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);
} catch (IOException e) {
e.printStackTrace();
}
}
代码示例来源:origin: windrunnerlihuan/DogCamera
public AndroidMuxer(String outputPath) {
// Create a MediaMuxer. We can't add the video track and start() the muxer here,
// because our MediaFormat doesn't have the Magic Goodies. These can only be
// obtained from the encoder after it has started processing data.
//
// We're not actually interested in multiplexing audio. We just want to convert
// the raw H.264 elementary stream we get from MediaCodec into a .mp4 file.
try {
mMuxer = new MediaMuxer(outputPath, MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);
} catch (IOException e) {
e.printStackTrace();
}
}
代码示例来源:origin: EasyDSS/EasyCamera
public EasyMuxer(String path, long durationMillis) {
mFilePath = path;
this.durationMillis = durationMillis;
Object mux = null;
try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
mux = new MediaMuxer(path + "-" + index++ + ".mp4", MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
mMuxer = (MediaMuxer) mux;
}
}
代码示例来源:origin: Car-eye-team/Car-eye-device
public EasyMuxer(String path, long durationMillis) {
mFilePath = path;
this.durationMillis = durationMillis;
Object mux = null;
try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
mux = new MediaMuxer(path + "-" + index++ + ".mp4", MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
mMuxer = (MediaMuxer) mux;
}
}
代码示例来源:origin: saki4510t/libcommon
@RequiresApi(api = Build.VERSION_CODES.O)
public MediaMuxerWrapper(final FileDescriptor fd, final int format)
throws IOException {
mMuxer = new MediaMuxer(fd, format);
}
代码示例来源:origin: WangShuo1143368701/VideoView
private void startRecord() {
try {
mMuxer = new MediaMuxer(mVideoPath + System.currentTimeMillis() + ".mp4", MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);
recordVirtualDisplay();
} catch (IOException e) {
e.printStackTrace();
} finally {
release();
}
}
代码示例来源:origin: aserbao/AndroidCamera
private void readyStart(String filePath) throws IOException {
isExit = false;
isVideoTrackAdd = false;
isAudioTrackAdd = false;
muxerDatas.clear();
mediaMuxer = new MediaMuxer(filePath, MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);
if (audioThread != null) {
audioThread.setMuxerReady(true);
}
if (videoThread != null) {
videoThread.setMuxerReady(true);
}
Log.e(TAG, "readyStart(String filePath, boolean restart) 保存至:" + filePath);
}
代码示例来源:origin: pedroSG94/rtmp-rtsp-stream-client-java
/**
* Start record a MP4 video. Need be called while stream.
*
* @param path where file will be saved.
* @throws IOException If you init it before start stream.
*/
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
public void startRecord(final String path) throws IOException {
mediaMuxer = new MediaMuxer(path, MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);
recording = true;
if (!streaming) {
startEncoders();
} else if (videoEncoder.isRunning()) {
resetVideoEncoder();
}
}
代码示例来源:origin: pedroSG94/rtmp-rtsp-stream-client-java
/**
* Start record a MP4 video. Need be called while stream.
*
* @param path where file will be saved.
* @throws IOException If you init it before start stream.
*/
public void startRecord(String path) throws IOException {
mediaMuxer = new MediaMuxer(path, MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);
recording = true;
if (!streaming) {
startEncoders(resultCode, data);
} else if (videoEncoder.isRunning()) {
resetVideoEncoder();
}
}
代码示例来源:origin: pedroSG94/rtmp-rtsp-stream-client-java
/**
* Start record a MP4 video. Need be called while stream.
*
* @param path where file will be saved.
* @throws IOException If you init it before start stream.
*/
public void startRecord(String path) throws IOException {
mediaMuxer = new MediaMuxer(path, MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);
recording = true;
if (!streaming) {
startEncoders();
} else if (videoEncoder.isRunning()) {
resetVideoEncoder();
}
}
代码示例来源:origin: pedroSG94/rtmp-rtsp-stream-client-java
/**
* Start record a MP4 video. Need be called while stream.
*
* @param path where file will be saved.
* @throws IOException If you init it before start stream.
*/
public void startRecord(String path) throws IOException {
mediaMuxer = new MediaMuxer(path, MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);
recording = true;
if (!streaming) {
startEncoders();
} else if (videoEncoder.isRunning()) {
resetVideoEncoder();
}
}
内容来源于网络,如有侵权,请联系作者删除!