Screenshot Oculus Quest 2 with ADB


JackDesBwa|3D
 

[This message starts a new thread derived from https://photo-3d.groups.io/g/main/message/128303 (Re: [Photo-3d] I've joined the club - Oculus Quest 2)]

I think that you are not stuck to writing a JPG in the emulated sdcard. You can probably get the image through the ADB channel with something like this: (unix syntax)
adb exec-out screencap -p > oculus_raw_screenshot.png

Even more awesome, you could also pipe the operations in imagemagick: (unix syntax again)
adb exec-out screencap -p | magick - -crop 50x100% +repage -distort barrel '0.1 -0.21 -0.4' +append oculus_screenshot.jpg
Well, you may have to adjust this command, because I am not totally sure to have understood the command you had in mind.

JackDesBwa


Gordon Au
 
Edited

Thanks, Jack. I've confirmed that PNG (as well as JPG) does work, and I'll test again the 'exec-out' writing externally. Both of those options failed for me initially, but may've been because the Guardian was slightly activated.

You can also capture binocular video from Oculus Quest with ADB:
http://developer.android.com/studio/command-line/adb#screenrecord

To convert to rectilinear, you can use FFMPEG with lens correction coefficients k2 = 0.1, k1 = -0.4 on each half of the video, and optional adjustment to square aspect ratio.


JackDesBwa|3D
 

To convert to rectilinear, you can use FFMPEG with lens correction coefficients k2 = 0.1, k1 = -0.4 on each half of the video, and optional adjustment to square aspect ratio.

I am curious... Could you give the full command?
I wonder if you need to use -filter_complex to process the two halves.

JackDesBwa


Gordon Au
 

On Fri, Jan 8, 2021 at 01:02 PM, Stereopix Net wrote:
I am curious... Could you give the full command?
I wonder if you need to use -filter_complex to process the two halves.
For combining, yes. I do it in multiple commands, since I want multiple end formats. For Mac terminal (~Unix), where input.mp4 is the raw binocular video from Oculus Quest:

ffmpeg -i input.mp4 -vf "crop=1832:1920:0:0,lenscorrection=k2=0.1:k1=-0.4" -r 30 -pix_fmt yuv420 -c:v libx264 left.mp4
ffmpeg -i input.mp4 -vf "crop=1832:1920:1832:0,lenscorrection=k2=0.1:k1=-0.4" -r 30 -pix_fmt yuv420 -c:v libx264 right.mp4
ffmpeg -i left.mp4 -i right.mp4 -filter_complex hstack parallel.mp4
ffmpeg -i right.mp4 -i left.mp4 -filter_complex hstack cross.mp4
ffmpeg -i left.mp4 -i right.mp4 -filter_complex "hstack,stereo3d-sbsl:arcd" -pix_fmt yuv420p -c:v libx264 anaglyph.mp4

These could be lumped together into an shell alias. The last line yields a Dubois anaglyph video; prior to that, I usually brighten the individual eye views—left with 1.3 and right with 1.1, via the vf filter 'eq=gamma=#'.

On my machine some of these commands run quite slowly, so I end up chopping longer videos into pieces to process them.