I got an idea to capture video as what the sensor "sees". i don't really know the right way to do this, so i tried to capture data the framebuffer device (fb0) as a video file by using ffmpeg 3.14 (or greater version) for ARM 32bit. i only got the menu screens, but not the live feed from the sensor and not videos played back on the camera. Also, the
/dev/video0 device can not be used or opened because of error "resource busy".
If "-framerate" option does not work, then try " -r " option in place. also change framerate and/or bitrate numbers according to your needs. To quit ffmpeg process early, press 'q' key. Afterwards, copy the
fb0-xvid.avi file to your computer via the command '
adb pull /mnt/extsd/fb0-xvid.avi' or by using a file manager. Note: /dev folder in the camera is in a temporary filesystem, so files copied to there will not stay after reboot/power-off.
Code:
adb shell mkdir /dev/bin
adb push ffmpeg /dev/bin/ffmpeg
adb shell
chmod 555 /dev/bin/ffmpeg
/dev/bin/ffmpeg -f fbdev -i /dev/graphics/fb0 -framerate 10 -vtag xvid -b:v 100k -bufsize 100k /mnt/extsd/fb0-xvid.avi
here is the captured video -
https://yadi.sk/i/tlT1xJML35Ao4b - and click 'Download' button on page
Alternatively, the ffmpeg file can be in
/mnt/extsd instead of
/dev directory. The x264 (h264) codec can be used explicitly with ffmpeg. A micro sd card with empty space should be inserted to the camera.
Code:
adb push ffmpeg /mnt/extsd/ffmpeg
adb shell
/mnt/extsd/ffmpeg -f fbdev -i /dev/graphics/fb0 -framerate 10 -c:v libx264 -vtag avc1 -b:v 100k -bufsize 100k /mnt/extsd/fb0-x264.avi
Here is this captured video -
https://yadi.sk/i/sQU6vCna35Pn6V - click 'Download' button.
also can capture the screen every 2 seconds to a picture file, total of 10 individual screenshots, and log output to a text file
fps=1/2 is every 2 seconds, so change fps=1/2 to fps=1/N for every N seconds
-frames 10 is total of ten screenshots, so change 10 to N for N total count of screenshots
Code:
mkdir /mnt/extsd/fb0screenshots
/mnt/extsd/ffmpeg -f fbdev -i /dev/graphics/fb0 -vf fps=1/2 -frames 10 /mnt/extsd/fb0screenshots/screenshot-%d.png 2> /mnt/extsd/ffmpeglog.txt
Here is this log text file -
https://www.dropbox.com/s/0sd2xu206mix08v/ffmpeglog.txt?dl=0
Also... it's peculiar how a linux binary can be executed from a vfat (fat32) file-system from the sdcard...
The Big Question:
How can I capture the live video feed from the sensor in the camera by using ffmpeg or any other tool directly, or over USB or via tcp/ip net?
references - https://ffmpeg.org/ffmpeg-devices.html#fbdev | and | https://trac.ffmpeg.org/wiki
ffmpeg static binary only, download - https://www.dropbox.com/s/g70fgvj6hqv93i9/ffmpeg-3.1.4-armel-bin-upx.zip?dl=0