What is the Android equivalent of / dev / video0 for a tablet camera?

Is there a file / dev / video 0 for an Android camera? I want to capture a camera preview through ffmpeg on Android. For instance:

ffmpeg -f video4linux2 -i /dev/video0 out.mpeg 
+6
source share
1 answer

The answer is probably very device dependent, and in most cases you cannot use the v4l camera directly without using / not setting up rom on the device. That's why:

  • A device manufacturer can provide closed-source camera drivers that are not compatible with v4l (the definition of compatibility with Android says nothing about camera drivers compatible with video 4linux) or Files
  • / dev / video * may not be accessible from the application / shell due to file permissions (I see the / dev / video 20 device on my phone, but the file is only available for root)

However, there is a good Java API for accessing the cameras: http://developer.android.com/reference/android/hardware/Camera.html

0
source

Source: https://habr.com/ru/post/887447/


All Articles