After switching the orientation, the recorded video is blurry
Describe the bug The recorded video was normal at first, but then I wanted to get a narrow resolution, so I switched the Orientation. Then I found that the recorded video was blurry, especially when moving quickly. On this basis, I switched from Camera2 source to Camera1 source and it returned to normal.
To Reproduce The test used a resolution of 1920x1080
- Go to 'RotationActivity'
- Change orientation to Vertical, the recorded video is blurry
- Then switch the Video source to Camera1, the recorded video is normal
Smartphone (please complete the following information):
- Library version [2.6.5]
- Device: [HUAWEI P50(ABR-AL80) Android 12]
- Class used [RotationActivity]
Additional context This problem was tested on another vivo phone (Y36c Android 14) and it was normal.
Vertical-Camera2-Blurry: https://github.com/user-attachments/assets/7ba93f25-cb77-4742-a64d-47b3286e461b
Vertical-Camera1-Normal: https://github.com/user-attachments/assets/83edaa84-2fb9-4257-91b6-0e7204c24a00
Hello,
This feels like a problem in autofocus Did you try to change to camera1 and then to camera2?
I initially used camera 2, and the test was normal. Then I switched the orientation to vertical, and the blur was noticeable when moving quickly. Then I switched to camera 1, and everything returned to normal.
Hello,
I means try this steps:
- Switch orientation
- Change to camera1
- Change to camera2
- Check if the blur is solved
Hello,
I means try this steps:
- Switch orientation
- Change to camera1
- Change to camera2
- Check if the blur is solved
I just tested it following these steps, and the result is still the same. Also, I noticed that the recorded video seems to be shorter than what I actually recorded.
I'm not able to reproduce it. How are you doing this "switch orientation"? Are you streaming/recording while you do it? Can you share a video example where you can see that error?
1.The "switch orientation" I'm referring to is the "Orientation" option in the demo app.
2.My process is done step by step. For example, I record using Camera2, then stop, then switch Orientation, and then record again.
3.The blurry video I recorded has a link attached. Vertical-Camera2-Blurry: https://github.com/user-attachments/assets/7ba93f25-cb77-4742-a64d-47b3286e461b
Vertical-Camera1-Normal: https://github.com/user-attachments/assets/83edaa84-2fb9-4257-91b6-0e7204c24a00
4.Other information: I turned off the autofocus you mentioned, but it still doesn't work. And the video stream is blurry when the phone is moving.
Hello,
After check the videos now I can understand your case. With camera2 you are recording to 30fps but with camera1 you are recording with 15fps So you should increment your bitrate because if you record with more fps you will need more bitrate. Since you are doing a video of 1080x1920 try with 8000 * 1000 of video bitrate.
You're right, the two videos have different frame rates.
The default FPS in the prepareVideo method is 30, but why is the frame rate 30 for camera2 and 15 for camera1? In my latest test, I only switched the video source.
Maybe a bug in Camera1Source or a limitation in Camera1 implementation of your device.
- If it is a bug, the Camera1 code is selecting fps in range 15-30 producing that problem.
- If it is a problem of your device, then your device can't open with camera1 to fps range 30-30 using camera1 in that resolution.
This check log line in your logcat: https://github.com/pedroSG94/RootEncoder/blob/master/encoder/src/main/java/com/pedro/encoder/input/video/Camera1ApiManager.java#L193
To know the value selected by the library.
If the value is incorrect, we need to check this line: https://github.com/pedroSG94/RootEncoder/blob/master/encoder/src/main/java/com/pedro/encoder/input/video/Camera1ApiManager.java#L192 To fix the error