抱歉,该视频无法在 Android 中流式传输到此设备
对于尝试播放录制的音频和视频时出现的警告,我们没有得到任何解决方案。警告是
抱歉,该视频无法流式传输到此设备。
我们使用以下代码,该代码在之前的设备(Nexus One)中已经运行良好。
recorder = new MediaRecorder();
recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setVideoSize(176, 144);
recorder.setVideoFrameRate(15);
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.DEFAULT);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setMaxDuration(30000);
recorder.setPreviewDisplay(holder.getSurface());
recorder.setOutputFile(OUTPUT_FILE);
recorder.prepare();
recorder.start();
我们的设备 Samsung Galaxy Pop S5570 仅支持 mp3 和 mp4,因此我们也尝试使用以下代码。请建议我以下代码是否正确,用于录制 mp4 视频格式
recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
recorder.setVideoSize(176, 144);
recorder.setVideoFrameRate(15);
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setMaxDuration(30000);
recorder.setPreviewDisplay(holder.getSurface());
recorder.setOutputFile(OUTPUT_FILE);
请提供任何可用于录制 mp4 视频和 mp3 音频格式的代码。
We are not getting any solution for the warning which is occurring when we are trying to play the recorded audio and video. The warning is
sorry this video is not valid for streaming to this device'.
We are using the following code which was already worked well in previous device(Nexus One).
recorder = new MediaRecorder();
recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setVideoSize(176, 144);
recorder.setVideoFrameRate(15);
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.DEFAULT);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setMaxDuration(30000);
recorder.setPreviewDisplay(holder.getSurface());
recorder.setOutputFile(OUTPUT_FILE);
recorder.prepare();
recorder.start();
And our device Samsung Galaxy Pop S5570 will support only mp3 and mp4 so we tried by using the following code also. Please suggest me the below code is correct, for recording mp4 video format
recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
recorder.setVideoSize(176, 144);
recorder.setVideoFrameRate(15);
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setMaxDuration(30000);
recorder.setPreviewDisplay(holder.getSurface());
recorder.setOutputFile(OUTPUT_FILE);
Pleas provide any code available for recording the mp4 video and mp3 audio format.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请尝试使用以下设置
,
这对我有用
please try to use following Settings
where
This has worked for me