JF https://www.javantea.com/page/make/323

For every process there may be many ways to do it, but only one way can be chosen at a time.

mplayer 
    -tv driver=v4l:width=640:height=480 
    -vo x11 tv://
It is up to the engineer to ensure that processes are done the best way all the time. But sometimes the best way depends on circumstances instead of controlled parameters. For example, starting laundry after eating breakfast may be less efficient than the reverse. Starting cd burning before laundry might even be more efficient. An engineer is not going to waste time figuring this out if it does not effect the overall efficiency more than the time spent thinking about it. This is the engineer's task: find the best way and do it efficiently.

It took me a few hours today to figure out the above command line which is perhaps the most efficient way to capture webcam pics with my setup. My setup is not normal, though. I run Linux 2.6.1 (soon 2.6.2). I have a D-Link WebCam that features the ov511 chipset. For over a year, I have been able to use this webcam under linux. I have used various methods of capturing. However, recently I have had less luck. You see, there is a strange autobrightness that the cam has which starts at dark and gets brighter until it looks nice. That's fine because it only happens once for 30 seconds. But xawtv has a bug where each time it captures a frame, it redoes brightness. I worked with xawtv and the ov511 drivers for a while to try to fix it. But no luck at all. I finally decided that MPlayer would do the job better. I worked with MPlayer. It didn't take long before I got a picture; I was happy with that. MPlayer also has an encoder so if I wanted, I could record my webcam to XviD compressed video file. But I can use transcode for that if I wish. But MPlayer has features that transcode and xawtv do not. I can send video output to x11 (graphics system) instead of xv (accelerated video). Why would I want that? Because x11 can be captured by Gimp or KSnapShot while xv cannot. I chose to use Gimp because it can save directly to jpeg. It's not as easy to capture involving a dozen clicks instead of 3 for KSnapshot, but I decided to use whatever worked. (KSnapshot saves to png which could be converted to jpeg with a simple script, but window decorations would have to be clipped also which would be a not so easy script.)

So the lesson for today is obviously about finding the best way, right? Well, I want to encourage people out there to spend an hour or two thinking about possible solutions to the problems you face. Not just huge, life threatening problems. Not just those you face on a daily basis. Think about problems that interest you and that may stop you from doing more with your time. What problems? I imagine a person who reads this page has a few problems I could solve with some ingenuity and some engineering. Perhaps you write programs every day. These programs are not complex, but they have to be done and they take time. Stop for one hour. Think outside the box to solve this problem. Could a robot solve this problem? How many robots do you know how to program? Could you program a robot to do your work for you? Would you mind a robot doing your work for you if you wrote the robot's intelligence? Could a simple script do everything that takes you an hour everday? Could you do something interesting very easily with a certain tool? Reason may tell you that what works before will work today, but reason also says that the future brings new things that will change what you do today. Change is good.

Permalink

Comments: 0

Leave a reply »

 
  • Leave a Reply
    Your gravatar
    Your Name