<p>I've successfully installed <code>mjpg-streamer-experimental</code> from <a href="https://github.com/jacksonliam" rel="nofollow noreferrer">jacksonliam</a>/<a href="https://github.com/jacksonliam/mjpg-streamer" rel="nofollow noreferrer"><strong>mjpg-streamer</strong></a>.</p>
<p>I just can't figure out how to set the parameter I need in order to rotate my camera 180 degrees (I have my webcam mounted upside down for a custom mount I made).</p>
<p>I'm using a Logitech C270. I've been searching online for hours for a solution to this issue and just can't find what I'm looking for. Doesn't help that I'm not very proficient when it comes to this stuff.</p>
<hr />
<p>If I run the command suggested in GiF's <a href="https://3dprinting.stackexchange.com/a/4823/4762">answer</a>:</p>
<pre><code>mjpg_streamer -i 'input_uvc.so -rot 180'
</code></pre>
<p>I get the following error:</p>
<pre><code> libv4l2: error setting pixformat: Device or resource busy Unable to set format: 1196444237 res: 640x480 Init v4L2 failed !! exit fatal i: init_VideoIn failed 
</code></pre>
<p>I seem to get that error when setting any parameters. I'm running Octoprint, if that makes any difference. There doesn't seem to be a rotate option in Octoprint.</p>
<p>Information just seems extremely sparse on this particular fork of mjpg-streamer. Searching for that error just gets me a bunch of people that have non-working webcams while mine works perfectly, I just need to rotate it 180 degrees.</p>
<hr />
<p>I would <em>really</em> appreciate some help!</p>

[{'answer_id': 4823, 'author': 'GiF', 'author_id': 8864, 'author_profile': 'https://3dprinting.stackexchange.com/users/8864', 'pm_score': 3, 'selected': False, 'text': '<p><strong>Edit: Having now installed Octopi myself, I have found that they made it easy to rotate the image right from the interface. If you open the &quot;Settings&quot; and look under &quot;Webcam &amp; Timelapse&quot;, there are settings for flipping the image horizontally or vertically and for rotating 90 degrees.</strong></p>\n<hr />\n<p>There are a few ways to rotate the image of which I am aware. You can do it via the input plugin, the client, or post-processing.</p>\n<p>The &quot;input_uvc&quot; and &quot;input_raspicam&quot; plugins both have options to rotate the image. If you are using one of these plugins see the documentation at <a href="https://github.com/jacksonliam/mjpg-streamer/blob/master/mjpg-streamer-experimental/plugins/input_uvc/README.md" rel="nofollow noreferrer">input_uvc</a> or <a href="https://github.com/jacksonliam/mjpg-streamer/blob/master/mjpg-streamer-experimental/plugins/input_raspicam/README.md" rel="nofollow noreferrer">input_raspicam</a> (it is worth noting that the input options may not be supported by all cameras). You should be able to run the command like the following to get a stream that is rotated 180 degrees:</p>\n<pre><code>mjpg_streamer -i \'input_uvc.so -rot 180\'\n</code></pre>\n<p>I\'m not sure how you are handling the stream, but it is possible that your client can perform the rotation. For example, if you are using VLC you can set the angle of rotation by doing something like this:</p>\n<ul>\n<li>Open the “Tools” menu and select “Effects and Filters”</li>\n<li>In the “Adjustments and Effects” window, on the “Video Effects” tab, select the “Transform” check box</li>\n<li>Select a rotation from the dropdown menu and then click “Close”.</li>\n</ul>\n<p>Finally, if you are saving the stream and are only concerned with rotating it afterwards, you can post-process it with a utility like <code>ffmpeg</code>. See this <a href="https://superuser.com/questions/578321/how-to-rotate-a-video-180-with-ffmpeg">post</a> as an example and look for &quot;Rotate&quot; in the accepted answer.</p>\n<p>If your stream is being rendered via a browser you may be able to add some CSS3 formatting to the video element. For example, you could add an ID of <code>videoElement</code> to the stream and then add the following to your CSS:</p>\n<pre><code> #videoElement {\n    transform: rotateZ(180deg);\n    -webkit-transform:rotateZ(180deg); /* Safari and Chrome */\n    -moz-transform:rotateZ(180deg); /* Firefox */ \n}\n</code></pre>\n<p>With respect to Octoprint, it appears that Octoprint is an HTML interface, so you could probably edit the markup to use CSS3\'s transform <code>rotateX</code>. That would rotate the image at the client end (browser). BTW, googling for your error code did have some potentially useful information as well.</p>\n'}, {'answer_id': 16723, 'author': 'BgWebDesign', 'author_id': 29312, 'author_profile': 'https://3dprinting.stackexchange.com/users/29312', 'pm_score': 2, 'selected': False, 'text': '<p>From the <code>help</code> for input plugin &quot;<strong>raspicam</strong>&quot;, the following parameters can be passed to this plugin:</p>\n<pre><code>[-fps | --framerate]...: set video framerate, default 5 frame/sec\n[-x | --width ]........: width of frame capture, default 640\n[-y | --height]........: height of frame capture, default 480\n[-quality].............: set JPEG quality 0-100, default 85\n[-usestills]...........: uses stills mode instead of video mode\n[-preview].............: Enable full screen preview\n[-timestamp]...........: Get timestamp for each frame\n</code></pre>\n<pre><code>-sh : Set image sharpness (-100 to 100)\n-co : Set image contrast (-100 to 100)\n-br : Set image brightness (0 to 100)\n-sa : Set image saturation (-100 to 100)\n-ISO : Set capture ISO\n-vs : Turn on video stablisation\n-ev : Set EV compensation\n-ex : Set exposure mode (see raspistill notes)\n-awb : Set AWB mode (see raspistill notes)\n-ifx : Set image effect (see raspistill notes)\n-cfx : Set colour effect (U:V)\n-mm : Set metering mode (see raspistill notes)\n-rot : Set image rotation (0-359)\n-stats : Compute image stats for each picture (reduces noise for -usestills)\n-drc : Dynamic range compensation level (see raspistill notes)\n-hf : Set horizontal flip\n-vf : Set vertical flip\n</code></pre>\n<p>The <strong>-rot</strong> parameter can rotate the image.</p>\n'}]
['https://3dprinting.stackexchange.com/questions/4822', 'https://3dprinting.stackexchange.com', 'https://3dprinting.stackexchange.com/users/8862/']