Background
While taking photos from the blog, I realized that I needed a better solution to monitoring and controlling my phone. I recall that during the pandemic, there were new methods to connect a phone camera to a computer.
Finding a Solution
A quick search of “view phone screen linux” found the following article
The suggested software was
I decided to give it a shot as if I could get it working, it would save me a lot of time from resetting the framing.
Setting up scrcpy
the instructions for fedora were very straight forward.
instructions
- Add the copr repo
sudo dnf copr enable zeno/scrcpy
- run
sudo dnf install scrcpy
- scrcpy should be installed
issues I ran into
However I ran into issues with the second step.
sudo dnf install scrcpy
Copr repo for scrcpy owned by zeno 10 kB/s | 2.4 kB 00:00
Error:
Problem: conflicting requests
- nothing provides libavcodec.so.58()(64bit) needed by scrcpy-1.18-2.fc33.x86_64
- nothing provides libavcodec.so.58(LIBAVCODEC_58)(64bit) needed by scrcpy-1.18-2.fc33.x86_64
- nothing provides libavdevice.so.58()(64bit) needed by scrcpy-1.18-2.fc33.x86_64
- nothing provides libavdevice.so.58(LIBAVDEVICE_58)(64bit) needed by scrcpy-1.18-2.fc33.x86_64
- nothing provides libavformat.so.58()(64bit) needed by scrcpy-1.18-2.fc33.x86_64
- nothing provides libavformat.so.58(LIBAVFORMAT_58)(64bit) needed by scrcpy-1.18-2.fc33.x86_64
- nothing provides libavutil.so.56()(64bit) needed by scrcpy-1.18-2.fc33.x86_64
- nothing provides libavutil.so.56(LIBAVUTIL_56)(64bit) needed by scrcpy-1.18-2.fc33.x86_64
(try to add '--skip-broken' to skip uninstallable packages)
$ sudo dnf install scrcpy --skip-broken
I had a feeling I was missing some video codec dependencies. The first error nothing provides libavcodec.so.58()(64bit)
caught my attention
a quick search of nothing provides libavcodec.so.58()(64bit)
yielded the fedora subreddit question that was related to installing ffmpeg.
I decided to install ffmpeg, since on my desktop, it is used for other applications
The following guide was helpful, since it had been a while since I last installed ffmpeg.
After installing the libavcodecs, I was able to install scrcpy.
Running scrcpy
Once scrcpy is installed, you can run scrcpy
in the terminal. Make sure your android device has remote usb debugging.
Here’s a good guide for how to enable it
You might need developer mode enabled, so here’s a good guide if you aren’t familiar with developer mode
When you connect your android phone, the following message should appear.
Once you allow it, scrcpy will show up.
By default, scrcpy will launch with a screen in the vertical position to rotate it, refer to the following instructions
I used the 90° rotations
scrcpy --lock-video-orientation=1 # 90° counterclockwise
scrcpy --lock-video-orientation=3 # 90° clockwise
The other nice thing about scrcpy is that your keyboard and mouse inputs are transferred to android. I found this useful in engaging the shutter without changing the position of my phone.