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.