I am implementing video recording application using Camera2 api. I've used
Google samples for video recording. However, there's an audio, video out of sync issue on some devices, such as Samsung J5, J6. I have changed MediaRecorder.AudioEncoder, MediaRecorder.VideoEncoder, VideoEncodingBitrate, but it could not help me. How to handle audio, video sync issue?
How to fix video & audio out of sync issue on android Video Recording using Camera api 2?
1.8k views Asked by Murodjon Abdukholikov At
1
There are 1 answers
Related Questions in ANDROID-CAMERA2
- Camera2 how to detect focus on a metering area
- MAUI - Android Camera2 - How set Rotate and Crop in CaptureRequest
- Using Camera2 with physical lenses does not show all lenses on all phones
- Long initialization of USB camera when using Camera X
- Set up remote camera monitoring on Android OS without user input
- Saving Images as Ultra HDR (JPEG_R)
- CameraX custom OpenGL Video Pipeline (`UseCase`/`VideoOutput`)
- Manual white balance using Camera2 API on Google Pixel phones
- Android Camera 2 API , Focus Distance and EV Control query
- Understanding LENS_FOCUS_DISTANCE Accuracy and Calculation for Distance Measurement on Samsung S22
- Android FotoApparat library how to make the cameraView zoom how?
- Android - Camera2 tap to focus not working
- How can i perfectly Pass Processed frames to Display?
- Android - take a 200mp photo programmatically
- Android: Get native HardwareBuffer Format (ImageFormat.PRIVATE)
Related Questions in MEDIARECORDER
- MediaRecorder.stop() throwing illegalException
- Media Recorder API encoding audio/mp4 stream to base64 string
- MediaRecorder RecordedChunks Empty Issue in React Component - Unable to get Recorded Audio
- MediaStream error obstructs audio recording from microphone
- audio element's 'readystatechange' is not called on devices running ios 17, readyState stays at 0
- Failed to decode HLS by FFMpeg command. Invalid NAL unit 0
- Capturing System Audio Through Microphone Input in a Next.js App Without Headphones
- FFMPEG ERROR on streaming video generated from MediaRecorder API on RTMP url
- Issue capturing user audio on Safari / iPhone through react web app
- Convert ArrayBuffer to AudioBuffer
- audio base 64 blob to linear16
- Record Audio with MediaRecorder in Android 8 goes crash
- Video recorded using MediaRecorder Web API comes with audio sped up
- How to convert and merge a list of webm files into a single large mp4 file with Node.js?
- How to send and recieve client webcam MediaStream stream data to django channels for image processing and displaying on client side
Related Questions in ANDROID-VIDEO-RECORD
- android capture intruder video from lockscreen
- Video recording and Frame processing at same time in Android using CameraX
- How to do background recording with front camera in Android using Kotlin
- Can I save timestamp in a video file on Android?
- Recording SurfaceView in Android
- Can we do Speech Recognition and Video Capture in Android using camerax simultaneously?
- Android ACTION_VIDEO_CAPTURE - Only owner is able to interact with pending item content
- Use MediaRecorder API instead of Intent for camera recording in Android
- MediaRecorder - safe outputformat (video container) and codec to record playable video even when a device suddenly turns off
- Android how to stream video to remote server
- Android: How to decect video size with Android Camera API
- Camera app fails on android ffmpeg application
- How to get camera permission android
- Use both back and front camera for the same MediaRecorder session Camera2API
- Android : Unable to preview video recorded during authoring
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
I've found a solution from this article. It mightn't be the best solution but it works. To solve the out of sync issue, mp4parserlibrary is utilized. First, video recording workflow is the same as just normal video recording, but , there's an extra step for the problematic devices. I will below provide my answer. First step of video recording is to prepare MediaRecorder, to shorten my answer I'll omit some steps.
To stop video recording
The last and important step is to call parseVideo function
In the parser function it checks the delta value, if it's bigger than 10000, it processes the recorded video and returns the result. In case if the delta value is less than 10000, it just returns video without processing. For more details, please refer to the link. Hope it helps you.