apivideo/api.video-reactnative-live-stream

[Bug]: Unable to retrieve camera characteristics for unknown device 0:

Closed this issue · 2 comments

Version

v1.2.3

Which operating systems have you used?

  • Android
  • iOS

Environment that reproduces the issue

I am getting this issue

getCameraCharacteristics:851: Unable to retrieve camera characteristics for unknown device 0: No such file or directory (-2)

Is it reproducible in the example application?

Yes

RTMP Server

api.video

Reproduction steps

Install @api.video/react-native-livestream and follow this doc for android

package.json
{
"name": "scratch",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
},
"dependencies": {
"@api.video/react-native-livestream": "^1.2.4",
"@invertase/react-native-apple-authentication": "^2.2.2",
"@react-native-async-storage/async-storage": "^1.18.1",
"@react-native-community/datetimepicker": "^7.6.2",
"@react-native-community/geolocation": "^3.0.6",
"@react-native-firebase/app": "^17.5.0",
"@react-native-firebase/auth": "^17.5.0",
"@react-native-firebase/database": "^17.4.3",
"@react-native-firebase/storage": "^17.4.3",
"@react-native-google-signin/google-signin": "^9.0.2",
"@react-navigation/bottom-tabs": "^6.5.7",
"@react-navigation/native": "^6.1.6",
"@react-navigation/native-stack": "^6.9.12",
"@turf/turf": "^6.5.0",
"axios": "^1.4.0",
"color": "^4.2.3",
"date-fns": "^2.29.3",
"geolib": "^3.3.4",
"javascript-time-ago": "^2.5.9",
"lottie-react-native": "^5.1.6",
"polished": "^4.2.2",
"react": "18.1.0",
"react-hook-form": "^7.50.0",
"react-native": "0.70.6",
"react-native-autocomplete-dropdown": "^3.1.4",
"react-native-contacts": "^7.0.5",
"react-native-context-menu-view": "^1.14.1",
"react-native-device-info": "^10.12.0",
"react-native-dropdown-picker": "^5.4.6",
"react-native-element-dropdown": "^2.10.1",
"react-native-fbsdk-next": "^11.1.0",
"react-native-feather": "^1.1.2",
"react-native-geocoding": "^0.5.0",
"react-native-gesture-handler": "^2.15.0",
"react-native-global-props": "^1.1.5",
"react-native-image-crop-picker": "^0.38.0",
"react-native-international-phone-number": "^0.6.7",
"react-native-keyboard-accessory": "^0.1.16",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-maps": "^1.7.1",
"react-native-modal": "^13.0.1",
"react-native-modalize": "^2.1.1",
"react-native-onesignal": "^5.0.3",
"react-native-pager-view": "^6.2.2",
"react-native-radio-buttons-group": "^3.0.5",
"react-native-reanimated": "^3.7.1",
"react-native-reanimated-carousel": "^3.3.0",
"react-native-safe-area-context": "^4.5.0",
"react-native-screens": "^3.20.0",
"react-native-secret-chamber": "^0.3.0",
"react-native-svg": "^13.8.0",
"react-native-tab-view": "^3.5.2",
"react-native-toast-message": "^2.2.0",
"react-native-video": "^5.2.1",
"react-native-webview": "^11.6.2",
"react-query": "^3.39.3",
"yup": "^1.0.2"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@react-native-community/eslint-config": "^2.0.0",
"@tsconfig/react-native": "^2.0.2",
"@types/axios": "^0.14.0",
"@types/color": "^3.0.3",
"@types/jest": "^26.0.23",
"@types/react": "^18.0.21",
"@types/react-native": "^0.70.6",
"@types/react-native-global-props": "^1.1.3",
"@types/react-native-video": "^5.0.19",
"@types/react-test-renderer": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.1",
"babel-jest": "^26.6.3",
"babel-plugin-module-resolver": "^5.0.0",
"eslint": "^8.35.0",
"eslint-import-resolver-typescript": "^3.5.3",
"eslint-plugin-import": "^2.27.5",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "0.72.3",
"react-native-svg-transformer": "^1.0.0",
"react-test-renderer": "18.1.0",
"typescript": "^4.9.5"
},
"jest": {
"preset": "react-native",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
]
}
}

Expected result

It should Start camera and start streaming without any errorthe

Actual result

But I am getting the below issue

Screenshot 2024-03-29 at 9 11 12 PM

Additional context

No response

Relevant logs output

No response

Hi,

This issue is because in the current version we supposed that camera with id "0" is the default camera. Till few months that seems to work on 100% of the mobile devices. Unfortunatly it is not the case, on some device camera with id "0" des not exist. The only time I saw this was on an emulator, are you running on an emulator? What devices? Have you try another device?

As a matter of fact, the current version of this library is not in a good state as said in the README.md:

:warning: **The React Native Live Stream SDK is designed for 0.69.1 version of React Native. Using the SDK with >0.69.1 of React Native can cause unexpected behaviour**

And as it is not up to date, I can't even build it on my computer.

The good news is that we are working on a new version where your issue has already fixed. See #67. Development is done, we are fixing few bugs. If your application ETA is not 2 days, you could use this branch directly. Remove the current package and run:

yarn add https://github.com/apivideo/api.video-reactnative-live-stream.git#feature/new_arch_support

Before you ask, we don't have a release date yet.

It should be resolved with 2.0.0.
If not, please reopen this issue.