Site update

This commit is contained in:
CronyAkatsuki 2025-01-20 19:08:23 +01:00
parent 732646b3d5
commit 66311ee207
10 changed files with 580 additions and 13 deletions

View file

@ -46,6 +46,9 @@
<section class="list">
<a href="/blog/phone-wireless-webcam-linux/">
20-01-2025 || How to setup a phone as wireless webcam on linux</a><br />
<a href="/blog/securing-ssh/">
04-04-2024 || Securing SSH</a><br />

View file

@ -6,11 +6,80 @@
<description>Recent content in Blog on Crony Akatsuki&#39;s Website</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
<lastBuildDate>Thu, 04 Apr 2024 20:44:10 +0200</lastBuildDate>
<lastBuildDate>Mon, 20 Jan 2025 18:16:55 +0100</lastBuildDate>
<atom:link href="https://cronyakatsuki.xyz/blog/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>How to setup a phone as wireless webcam on linux</title>
<link>https://cronyakatsuki.xyz/blog/phone-wireless-webcam-linux/</link>
<pubDate>20-01-2025</pubDate>
<guid>https://cronyakatsuki.xyz/blog/phone-wireless-webcam-linux/</guid>
<description>&lt;p&gt;Anybody else need to have a webcam nowdays because of all the remote stuff that has started happening since covid, getting forced into having a webcam so that your boss/teacher/professor can follow what you are doing but don&amp;rsquo;t wanna spend money on getting one and you are luckilly using linux? Then look no further because if you have a decent phone ( S24 in my case ) you can have use it as a wireless webcam ( or usb if your android version is lover than 14 ).&lt;/p&gt;
&lt;p&gt;I will now show you the steps and some basic settings and a script to simplify the steps.&lt;/p&gt;
&lt;!-- raw HTML omitted --&gt;
&lt;h1 id=&#34;1-enable-wirelessusb-debugging-on-your-phone&#34;&gt;1. Enable Wireless/Usb Debugging on your phone&lt;/h1&gt;
&lt;p&gt;First you will have to enable wireless/usb debugging on your phone. The steps can somewhat differ depending on your phone and as such I will use my phone as an example.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Enter your settings&lt;/li&gt;
&lt;li&gt;Enter &amp;ldquo;About phone&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Enter &amp;ldquo;Software Information&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Click on &amp;ldquo;Build number&amp;rdquo; until a popup tells you developer mode has been enable&lt;/li&gt;
&lt;li&gt;Exit back to main menu of settings and enter &amp;ldquo;Developer Options&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Enable Wireless/Usb debugging&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Note that for Wireless Debugging you will have to enable it again every time you wanna use your phone as a webcam. To help with that you can ebale wireless debugging as a tile by going to developer options&amp;gt;&amp;ldquo;Quick settings for developer tiles&amp;rdquo; and enabling wireless debugging.&lt;/p&gt;
&lt;h1 id=&#34;2-installing-necesarry-software-on-your-linux-system&#34;&gt;2. Installing necesarry software on your linux system&lt;/h1&gt;
&lt;p&gt;Now we have to install the needed software on your linux system to make all this work. I will use arch as an example but will first list the software you need:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;android-tools (adb)&lt;/li&gt;
&lt;li&gt;v4l2loopback&lt;/li&gt;
&lt;li&gt;scrcpy&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;example command&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo pacman -S android-tools v4l2loopback-dkms scrcpy
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h1 id=&#34;3-pair-your-phone-with-your-pc-using-adb&#34;&gt;3. Pair your phone with your pc using adb&lt;/h1&gt;
&lt;p&gt;Now we will need to pair your phone using adb wirelessly with your pc.&lt;/p&gt;
&lt;p&gt;Go to wireless debugging settings on your phone, make sure it&amp;rsquo;s enable and click the pair with code option. Take note of the ip and port, you will have to use it on your pc.&lt;/p&gt;
&lt;p&gt;Next you have to run this command: &lt;code&gt;adb pair IP:PORT&lt;/code&gt;. After running the command you have to enter the pair code and press enter.&lt;/p&gt;
&lt;p&gt;And we are done, you are now connected to your phone.&lt;/p&gt;
&lt;h1 id=&#34;4-setup-video-dummy-device-and-output-camera-feed-to-it&#34;&gt;4. Setup video dummy device and output camera feed to it.&lt;/h1&gt;
&lt;p&gt;Now we need to setup a dummy video device using v4l2loopback driver, using this command : &lt;code&gt;sudo modprobe -v v4l2loopback exclusive_caps=1 card_label=&amp;quot;Virtual Webcam&amp;quot;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Now we need to use the command &lt;code&gt;v4l2-ctl&lt;/code&gt; to get which number the video device is, in my case it&amp;rsquo;s &lt;code&gt;/dev/video2&lt;/code&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;example&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; v4l2-ctl --list-devices
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Virtual Webcam &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;(&lt;/span&gt;platform:v4l2loopback-000&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;)&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; /dev/video2
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;HD User Facing: HD User Facing &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;(&lt;/span&gt;usb-0000:05:00.3-1&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;)&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; /dev/video0
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; /dev/video1
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; /dev/media0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now we can use scrcpy to get our phone&amp;rsquo;s camera and show it on your pc in a nice little window, in my case I use this command which is pretty long but will explain it:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;scrcpy --video-source&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;camera --no-audio --camera-facing&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;front --v4l2-sink&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;/dev/video2 --camera-fps&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ef9f76&#34;&gt;60&lt;/span&gt; --video-codec&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;h265 --camera-ar&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;4:3 -m1920 --capture-orientation&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;flip90
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now to explain the options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--video-source=camerate&lt;/code&gt; makes sure scrcpy uses your camera as the source&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--no-audio&lt;/code&gt; makes sure to not catch phone mic audio,&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--camera-facing=front&lt;/code&gt; uses front camera, you can change it to use back camera also&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--v4l2-sink=/dev/video2&lt;/code&gt; make sure to use the video output to your &amp;ldquo;Virtual Webcam&amp;rdquo;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--camera-fps=60&lt;/code&gt; uses 60fps mode of the camera&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--video-coded=h265&lt;/code&gt; provides better quality than &lt;code&gt;h264&lt;/code&gt;, but higher latency&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--camera-ar=4:3&lt;/code&gt; and &lt;code&gt;-m1920&lt;/code&gt; limits resolution to 1920 and makes it 4:3, for more caught on camera&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--capture-orientation=flip90&lt;/code&gt; flips the picture and rotates it by 90 degrees, you don&amp;rsquo;t need the 90 and can use just flip0 if you make your phone stand landscape&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And now you have a nice little window showing of your phone camera wirelessly on your pc. It is also accebible with software like zoom/obs/discord/&amp;hellip;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Hope you had a decent time reading this and have managed to get it all working with your nice new webcam ;)&lt;/p&gt;
</description>
</item>
<item>
<title>Securing SSH</title>
<link>https://cronyakatsuki.xyz/blog/securing-ssh/</link>

View file

@ -0,0 +1,179 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="/css/style.css" rel="stylesheet" />
<script defer data-domain="cronyakatsuki.xyz" src="https://plausible.cronyakatsuki.xyz/js/script.js"></script>
<title>
How to setup a phone as wireless webcam on linux - Crony Akatsuki
</title>
<meta property="og:url" content="https://cronyakatsuki.xyz/blog/phone-wireless-webcam-linux/">
<meta property="og:site_name" content="Crony Akatsuki&#39;s Website">
<meta property="og:title" content="How to setup a phone as wireless webcam on linux">
<meta property="og:description" content="Anybody else need to have a webcam nowdays because of all the remote stuff that has started happening since covid, getting forced into having a webcam so that your boss/teacher/professor can follow what you are doing but dont wanna spend money on getting one and you are luckilly using linux? Then look no further because if you have a decent phone ( S24 in my case ) you can have use it as a wireless webcam ( or usb if your android version is lover than 14 ).">
<meta property="og:locale" content="en_us">
<meta property="og:type" content="article">
<meta property="article:section" content="blog">
<meta property="article:published_time" content="2025-01-20T18:16:55+01:00">
<meta property="article:modified_time" content="2025-01-20T18:16:55+01:00">
<meta property="article:tag" content="Linux">
<meta property="article:tag" content="Android">
<meta property="article:tag" content="Scrcpy">
</head>
<body>
<header>
<h1>Crony Akatsuki</h1>
<nav>
<span><a href="/">Home</a></span>
<span>|</span>
<span><a href="/about">About</a></span>
<span>|</span>
<span><a href="/blog">Blog</a></span>
<span>|</span>
<span><a href="/services">Services</a></span>
</nav>
</header>
<main>
<div id="content">
<h1>How to setup a phone as wireless webcam on linux</h1>
<div id="blog-meta">
<p id="date">20-01-2025</p>
<p>
<span>|</span>
<a href="https://cronyakatsuki.xyz/tags/linux/">linux</a> <span>|</span>
<a href="https://cronyakatsuki.xyz/tags/android/">android</a> <span>|</span>
<a href="https://cronyakatsuki.xyz/tags/scrcpy/">scrcpy</a></p>
<hr>
</div>
<p>Anybody else need to have a webcam nowdays because of all the remote stuff that has started happening since covid, getting forced into having a webcam so that your boss/teacher/professor can follow what you are doing but don&rsquo;t wanna spend money on getting one and you are luckilly using linux? Then look no further because if you have a decent phone ( S24 in my case ) you can have use it as a wireless webcam ( or usb if your android version is lover than 14 ).</p>
<p>I will now show you the steps and some basic settings and a script to simplify the steps.</p>
<!-- raw HTML omitted -->
<h1 id="1-enable-wirelessusb-debugging-on-your-phone">1. Enable Wireless/Usb Debugging on your phone</h1>
<p>First you will have to enable wireless/usb debugging on your phone. The steps can somewhat differ depending on your phone and as such I will use my phone as an example.</p>
<ol>
<li>Enter your settings</li>
<li>Enter &ldquo;About phone&rdquo;</li>
<li>Enter &ldquo;Software Information&rdquo;</li>
<li>Click on &ldquo;Build number&rdquo; until a popup tells you developer mode has been enable</li>
<li>Exit back to main menu of settings and enter &ldquo;Developer Options&rdquo;</li>
<li>Enable Wireless/Usb debugging</li>
</ol>
<p>Note that for Wireless Debugging you will have to enable it again every time you wanna use your phone as a webcam. To help with that you can ebale wireless debugging as a tile by going to developer options&gt;&ldquo;Quick settings for developer tiles&rdquo; and enabling wireless debugging.</p>
<h1 id="2-installing-necesarry-software-on-your-linux-system">2. Installing necesarry software on your linux system</h1>
<p>Now we have to install the needed software on your linux system to make all this work. I will use arch as an example but will first list the software you need:</p>
<ul>
<li>android-tools (adb)</li>
<li>v4l2loopback</li>
<li>scrcpy</li>
</ul>
<blockquote>
<p>example command</p>
</blockquote>
<div class="highlight"><pre tabindex="0" style="color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>sudo pacman -S android-tools v4l2loopback-dkms scrcpy
</span></span></code></pre></div><h1 id="3-pair-your-phone-with-your-pc-using-adb">3. Pair your phone with your pc using adb</h1>
<p>Now we will need to pair your phone using adb wirelessly with your pc.</p>
<p>Go to wireless debugging settings on your phone, make sure it&rsquo;s enable and click the pair with code option. Take note of the ip and port, you will have to use it on your pc.</p>
<p>Next you have to run this command: <code>adb pair IP:PORT</code>. After running the command you have to enter the pair code and press enter.</p>
<p>And we are done, you are now connected to your phone.</p>
<h1 id="4-setup-video-dummy-device-and-output-camera-feed-to-it">4. Setup video dummy device and output camera feed to it.</h1>
<p>Now we need to setup a dummy video device using v4l2loopback driver, using this command : <code>sudo modprobe -v v4l2loopback exclusive_caps=1 card_label=&quot;Virtual Webcam&quot;</code>.</p>
<p>Now we need to use the command <code>v4l2-ctl</code> to get which number the video device is, in my case it&rsquo;s <code>/dev/video2</code></p>
<blockquote>
<p>example</p>
</blockquote>
<div class="highlight"><pre tabindex="0" style="color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span> v4l2-ctl --list-devices
</span></span><span style="display:flex;"><span>Virtual Webcam <span style="color:#99d1db;font-weight:bold">(</span>platform:v4l2loopback-000<span style="color:#99d1db;font-weight:bold">)</span>:
</span></span><span style="display:flex;"><span> /dev/video2
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>HD User Facing: HD User Facing <span style="color:#99d1db;font-weight:bold">(</span>usb-0000:05:00.3-1<span style="color:#99d1db;font-weight:bold">)</span>:
</span></span><span style="display:flex;"><span> /dev/video0
</span></span><span style="display:flex;"><span> /dev/video1
</span></span><span style="display:flex;"><span> /dev/media0
</span></span></code></pre></div><p>Now we can use scrcpy to get our phone&rsquo;s camera and show it on your pc in a nice little window, in my case I use this command which is pretty long but will explain it:</p>
<div class="highlight"><pre tabindex="0" style="color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>scrcpy --video-source<span style="color:#99d1db;font-weight:bold">=</span>camera --no-audio --camera-facing<span style="color:#99d1db;font-weight:bold">=</span>front --v4l2-sink<span style="color:#99d1db;font-weight:bold">=</span>/dev/video2 --camera-fps<span style="color:#99d1db;font-weight:bold">=</span><span style="color:#ef9f76">60</span> --video-codec<span style="color:#99d1db;font-weight:bold">=</span>h265 --camera-ar<span style="color:#99d1db;font-weight:bold">=</span>4:3 -m1920 --capture-orientation<span style="color:#99d1db;font-weight:bold">=</span>flip90
</span></span></code></pre></div><p>Now to explain the options:</p>
<ul>
<li><code>--video-source=camerate</code> makes sure scrcpy uses your camera as the source</li>
<li><code>--no-audio</code> makes sure to not catch phone mic audio,</li>
<li><code>--camera-facing=front</code> uses front camera, you can change it to use back camera also</li>
<li><code>--v4l2-sink=/dev/video2</code> make sure to use the video output to your &ldquo;Virtual Webcam&rdquo;</li>
<li><code>--camera-fps=60</code> uses 60fps mode of the camera</li>
<li><code>--video-coded=h265</code> provides better quality than <code>h264</code>, but higher latency</li>
<li><code>--camera-ar=4:3</code> and <code>-m1920</code> limits resolution to 1920 and makes it 4:3, for more caught on camera</li>
<li><code>--capture-orientation=flip90</code> flips the picture and rotates it by 90 degrees, you don&rsquo;t need the 90 and can use just flip0 if you make your phone stand landscape</li>
</ul>
<p>And now you have a nice little window showing of your phone camera wirelessly on your pc. It is also accebible with software like zoom/obs/discord/&hellip;</p>
<hr>
<p>Hope you had a decent time reading this and have managed to get it all working with your nice new webcam ;)</p>
</div>
</main>
<footer>
<div id="links">
<span><a href="https://code.cronyakatsuki.xyz">Code</a></span>
<span>|</span>
<span><a href="https://steamcommunity.com/id/CronyAkatsuki/">Steam</a></span>
<span>|</span>
<span><a href="https://osu.ppy.sh/users/18953565">Osu!</a></span>
<span>|</span>
<span><a href="https://anilist.co/user/CronyAkatsuki/">Anilist</a></span>
<span>|</span>
<span><a href="https://trakt.tv/users/cronyakatsuki">Trakt.tv</a></span>
<span>|</span>
<span><a href="https://www.last.fm/user/Crony-Akatsuki">Last.fm</a></span>
<span>|</span>
<span><a href="https://youtube.com/channel/UClFdlNlUipHG5Kit8GbFz5Q">Gaming Channel</a></span>
<span>|</span>
<span><a href="https://uptime.cronyakatsuki.xyz/status/public">Services Status</a></span>
<span>|</span>
<span><a href="https://lemmy.cronyakatsuki.xyz/u/crony">Lemmy</a></span>
<span>|</span>
<span><a href="https://sharkey.cronyakatsuki.xyz/u/crony">Sharkey</a></span>
<span>|</span>
<span><a href="https://plausible.cronyakatsuki.xyz/cronyakatsuki.xyz">Selfhosted Plausible Analytics</a></span>
</div>
<div id="banners">
<a rel="noreferrer" href="/" target="_blank"><img src="/88x31.png"
alt="Me" title="Me" /></a>
<a rel="noreferrer" href="https://kernel.org" target="_blank"><img src="https://cyber.dabamos.de/88x31/linux_powered.gif"
alt="linux kernel" title="Best kernel in the world" /></a>
<a rel="noreferrer" href="https://debian.org" target="_blank"><img src="https://cyber.dabamos.de/88x31/debian.gif"
alt="debian" title="This website run's on debian" /></a>
<a rel="noreferrer" href="https://bitwarden.com" target="_blank"><img src="https://cyber.dabamos.de/88x31/bitwarden.gif"
alt="Bitwarden" title="Bitwarden/Vaultwarden for the win" /></a>
<a rel="noreferrer" target="_blank"><img src="https://cyber.dabamos.de/88x31/free.gif"
alt="foss" title="Foss is the way" /></a>
<a rel="noreferrer" href="https://neovim.io" target="_blank"><img src="/assets/badges/neovim.gif"
alt="Neovim" title="Written in neovim" /></a>
<a rel="noreferrer" href="https://landchad.net" target="_blank"><img src="https://landchad.net/pix/landchad.gif"
alt="LandChad" title="Get A Website!" /></a>
<a rel="noreferrer" href="https://poggerer.xyz" target="_blank"><img src="https://poggerer.xyz/88x31.png"
alt="Tulg" title="Tulg" /></a>
<a rel="noreferrer" href="https://arthurmelton.com" target="_blank"><img src="https://arthurmelton.com/88x31.png"
alt="AMTitan" title="AMTitan" /></a>
<a rel="noreferrer" href="https://aadi.net.in" target="_blank"><img src="https://aadi.net.in/88x31.png"
alt="Aadi" title="Aadi" /></a>
<a rel="noreferrer" href="https://bear.oops.wtf/" target="_blank"><img src="https://bear.oops.wtf/download/88x31.png"
alt="Bear" title="Bear" /></a>
</div>
</footer>
</body>
</html>