VLC command line to open webcam and crop to specific size?


Recommended Posts

Could anyone help me create a VLC shortcut to automatically open the capture device /dev/video0 at 1024x576, and then crop and resize said video to a specific size, say 800x450?  

 

I have this security webcam set up, and whenever I bring my laptop home, I like to plug the camera into the laptop's USB port, fire up VLC, and use the laptop as the webcam monitor.  But because the webcam is super-wide-angle, I then also have to use ALT-R, ALT-C, ALT-D, and ALT-F, to manually crop the video one pixel at a time from each edge.  Then, because VLC automatically resizes the cropped video to full screen, this is effectively like having a 'digital zoom', to zoom in on the important bits in the center of the video feed.

 

While I don't know the exact dimensions of what I end up cropping the video to, I can find them out by trial and error.  But once I do figure out the exact dimensions, I would like to have a VLC shortcut on my desktop to automatically launch VLC, play the webcam fullscreen, and crop it to the specified dimensions, so I don't have to do it manually every time, one pixel at a time.

 

Any help would be greatly appreciated!  I tried googling, but I couldn't figure out how to combine a crop command with playing the /dev/video0 capture device.

I've tried this:

 

 

Basically, it's using the vfilter to subtract 100 pixels from all 4 sides, and it works, sort of.  When I manually use the alt-d/r/f/c keys to crop one pixel at a time, VLC automatically stretches the remaining video to full screen, while maintaining aspect ratio.  When I use vfilter=cropadd in the command line, I'm left with the small, cropped video at original size at the top left of the screen, and weird stretched out lines/graphical glitches filling the bottom and right sides of the screen.

 

I also tried this:

 

 

Which instead of using vfilter=cropadd in the transcode section, it uses V4L2's crop feature on the capture-device-input side of things.  :vout-filter=crop loads the crop filter into V4L2, and :crop-geometry="626x288+10+94" tells it to crop the 1024x576 video feed into 626x288, starting from (10,94).  

 

But it doesn't do a damn thing.  I must have the code wrong or something.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Towerborne, Construction Simulator, and more join Xbox Free Play Days this weekend by Pulasthi Ariyasinghe It's time for another weekend promotion from Microsoft's Free Play Days program, and this time has three games for Game Pass subscribers to jump into. Bassmaster Fishing, Construction Simulator, and Towerborne are now available to Xbox Game Pass Ultimate, Standard, and Core subscribers. As usual, any progress made during the weekend also carries over automatically if you decide to purchase a game afterward. From the trio, Towerborne is the looter brawler experience by Stoic, the studio behind The Banner Saga franchise. The title landed in early access late last year, offering players a side-scrolling action game set in a fantasy realm where you can brawl through enemies with up to three friends for upgrading your character with better gear and looks. Check out Neowin's own review of the Towerborne early access launch over here. Next arrives Construction Simulator, a popular entry in the sim space that lets you "fulfill your ambition to become a successful construction entrepreneur." You can manage the company itself, operate heavy machinery, complete a variety of building contracts, and more here. The title touts over 70 licensed construction vehicles and machines from real-world brands, two maps set in the US and Europe, as well as different types of projects. Lastly, Bassmaster Fishing offers competitive big bass fishing complete with fully licensed content. You'll be competing in the Elite Tour across 8 different real-world venues while climbing ranks and earning sponsors. There are even multiplayer modes to try out for competitive fishing. Here are the three latest Free Play Days games and their supported platforms: Bassmaster Fishing - $7.99 (Xbox Series X|S, Xbox One, PC) Construction Simulator - $19.99 (Xbox Series X|S, Xbox One, PC) Towerborne (Game Preview) - $18.74 (Xbox Series X|S, PC) This Free Play Days promotion will end on Sunday, June 15, at 11:59 pm PT. Following this, expect another round of games to enter the program next Thursday.
    • Trying to make me feel bad for taking issue with your website pushing the replacement of real authors as an opportunity to make "passive income" is a ridiculous waste of time and energy on your part. I am not criticizing you for having sponsored content on your website so you can keep the lights on. Don't project that onto me like I'm some sort of selfish monster just overreacting. The ###### software that your site is peddling will one day replace you and every other writer if you continue excusing it. Maybe you ought to get another partner that respects real human creators. Just a thought. And furthermore, your "but everybody is doing it" excuse is pathetic. There are a million other products in the world you could advertise, you never HAD to.
    • Apple CarPlay to let you stream iPhone videos to your car screen by Sagar Naresh Bhavsar In an official post for developers, Apple announced that CarPlay users will be able to watch iPhone videos on their car's display. This feature will be powered by Apple AirPlay, allowing users to stream videos wirelessly from their iPhones to their car's infotainment screen. For safety reasons, users will be able to enjoy videos on their car's display, but only when their vehicle is parked. Users won't be able to watch videos while the car is on the move. The connected iPhone will automatically detect when the car moves and will stop playing the video to avoid driver distraction. According to Apple, devs need to "integrate support for CarPlay with AirPlay video to enable this feature in your car." Carmakers will need to add support for CarPlay with AirPlay video to let users watch videos in their cars. So, this may take a while to roll out. Apple hasn't specifically mentioned whether it will be exclusive to the newly introduced and limited CarPlay Ultra, or standard CarPlay users will also be able to enjoy videos through AirPlay on their car's screen. Also, there is no clarity if existing models will get support via software update, or if it will be limited to newer models only. On the Android side, Google has also announced a bunch of new capabilities soon to be coming to Android Auto. The company has extended support for weather apps in beta for Android Auto and has confirmed that Android Auto will soon support video and browser apps as well. Image via Depositphotos
  • Recent Achievements

    • Week One Done
      fashionuae earned a badge
      Week One Done
    • One Month Later
      fashionuae earned a badge
      One Month Later
    • Week One Done
      elsafaacompany earned a badge
      Week One Done
    • Week One Done
      Yianis earned a badge
      Week One Done
    • Veteran
      Travesty went up a rank
      Veteran
  • Popular Contributors

    1. 1
      +primortal
      512
    2. 2
      ATLien_0
      265
    3. 3
      +FloatingFatMan
      195
    4. 4
      +Edouard
      174
    5. 5
      snowy owl
      125
  • Tell a friend

    Love Neowin? Tell a friend!