Video recording fails to save to file
See original GitHub issuestopVideoRecording()
always returns false, with no error
private var tmpVideoFile: File? = null
@SuppressLint("SimpleDateFormat")
@Throws(IOException::class)
private fun getNewVideoFile(): File {
// Create an image file name
val timeStamp: String = SimpleDateFormat("yyyyMMdd_HHmmss").format(Date())
val directory = "${Environment.getExternalStorageDirectory().absolutePath}/filmit/videos".also { File(it).mkdirs() }
return File(directory, "$timeStamp.mp4")
}
@SuppressLint("MissingPermission")
private fun listenToVideoRecordEvent() {
publisherDisposable = videoRecordEventPublisher.subscribe {
if (it) {
recordVideoFrame.visibility = View.VISIBLE
tmpVideoFile = getNewVideoFile()
recordVideoCamera.startVideoRecording(tmpVideoFile!!) {
// Configure video (MediaRecorder) parameters
audioEncoder = AudioEncoder.Aac
videoFrameRate = 60
videoStabilization = true
videoEncoder = VideoEncoder.H263
}
} else {
if(recordVideoCamera.stopVideoRecording()) {
uploadTmpVideo()
} else {
Log.e(TAG, "failed to save video to file")
Log.d(TAG, tmpVideoFile.toString())
}
recordVideoFrame.visibility = View.GONE
}
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Camera App Failed to Save Video File - Microsoft Community
I tried to see if I could change where the files are stored, but it's already set to a valid location: "C:\".
Read more >Screen Recording Failed to Save Due to Failed to ... - YouTube
How to fix Screen Recording failed to save due to failed to save screen recording in iOS 13, ... Your browser can't play...
Read more >What to Do if Screen Recording Failed to Save?
How to fix “Screen Recording failed to save” · Solution 1. Check For Screen Recording Restrictions · Solution 2. Update iOS version ·...
Read more >How To Fix Screen Recording Failed Errors due to 5823 ...
If you don't have enough storage space the recording won't be saved and will result in a failed attempt.
Read more >Recording failed to save at the end - CamStudio
I downloaded VirtualDub and when I tried to import the video file, I got an error message that "The file "c:\users\Kevin\Desktop\Documentor.avi" ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No error is thrown even after logging
It seems, on certain devices, the library is falling back to camera1 implementation and thus could not start video recording (not supported on camera1). Implementing video recording on camera1 might be a future enhancement. In regards with this issue, the library functions as designed.