2013-12-12 30 views
4

我正在編寫一個程序來記錄來自Android相機的視頻。 我能夠記錄它並將其存儲爲mp4。但我想記錄並將其存儲爲flv。 這是我的媒體記錄器配置。你能告訴我如何將它改成FLV記錄?我可以使用android保存flv格式錄製的視頻嗎?

mMediaRecorder.setPreviewDisplay(surface); 
    mMediaRecorder.setCamera(mCamera); 
    mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); 
    // mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT); 
    mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); 
    mMediaRecorder.setOutputFile(this.initFile().getAbsolutePath()); 
    mMediaRecorder.setMaxDuration(50000); 
    mMediaRecorder.setVideoFrameRate(15); 
    mMediaRecorder.setVideoSize(320, 240); 
    mMediaRecorder.setVideoEncodingBitRate(100000); 
    // mMediaRecorder.setAudioEncodingBitRate(8000); 
    mMediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263); 
    // mMediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); 

回答

2

基本上Android不支持.flv文件的視頻。所以你必須使用一些第三方視頻轉換器將.mp4轉換爲.flv文件。或者使用ffmpeg你可以做到這一點。

+0

你可能也想看看 http://en.wikipedia.org/wiki/Libavcodec – Nicolas

+0

非常感謝你的回答。 – Harikrishnan

相關問題