Go Down

Topic: How to Arduino Yun support Creative Live! VISTA VF0470 webcam? (Read 12338 times) previous topic - next topic


sonnyyu


@noblepepper: Thank you so much. My Webcam works now! Awesome job, thanks for your help.

I have one question regarding fswebcam, maybe someone has an answer to it:

fswebcam has a feature built in where you can write the actual date on the shots the cam makes. However I receive this error:

Code: [Select]
--- Processing captured image...
Unable to load font 'sans': libgd was not built with FreeType font support


I also tried to define the path to the font, then however I receive only the error that freetype font support is not given. I understand, that this is an issue of libgd, but maybe someone knows a workaround?

Thanks for your help.


recompile libgd with freetype support.

nano ~/OpenWrt-yun/package/feeds/packages/gd/Makefile

Code: [Select]
CONFIGURE_ARGS += \
        --enable-shared \
        --enable-static \
        --disable-rpath \
        --without-x \
        --without-fontconfig \
        --without-freetype \
        --with-jpeg=$(STAGING_DIR)/usr \
        --with-png=$(STAGING_DIR)/usr \
        --without-xpm \
        --without-iconv


remove " --without-freetype \" then recompile libgd. then remove installed libgd force install new revision one.  I have not chance to test it but you should go ahead try it yourself.

federicofissore

After you've tested it working, please create a pull request on the packages repo https://github.com/arduino/openwrt-packages-yun
(gd is here)

kaul

Thank you, Federico Fissore

Unfortunately I have little linux knowledge. I did the nano, but it seems this file does not exist. I am afraid of doing something wrong while compiling unless I find a step by step guide somewhere. If you can provide one that would be awesome, but I understand that u have limited time.

Thank you anyway and have a great day!

federicofissore

It's already available but it needs some hours to set up, a variable number of hours to build (my 4 cores i7 takes 6 hours) and about 30Giga of free disk space

If you feel it's too difficult, than probably it is. Still, you may want to give it a try, as it may be easier than you think :)

An alternative path is to build just the SDK (or to obtain one from the openwrt website) and adapt instructions like those from fibasile about nodejs, so that you can build a custom version of package gd

Last alternative is to look for a totally different solution: one could be using fswebcam for taking pictures and use another program for changing them adding time and date

kaul

Well, I just want to recompile libgd with freetype support. Do I need to recomile the whole openwrt for this?

If not, do you have any instructions how to recompile libgd?

Thank you for your patience with me ;)

federicofissore

Yes, as I said:


An alternative path is to build just the SDK (or to obtain one from the openwrt website) and adapt instructions like those from fibasile about nodejs, so that you can build a custom version of package gd


Openwrt has a 32bit version of it for Attitude Adjustment (OpenWrt-Yun is a custom version of it) here
On their wiki there's a "usage" paragraph http://wiki.openwrt.org/doc/howto/obtain.firmware.sdk#usage

I've never used it, so I cannot give you specific support

federicofissore

On a second thought, maybe the Toolchain suffices. I really don't know for sure...

khchan

Hi Kaul,

If you would like to add time stamp to your picture once you saving it, maybe this link able to help you :
https://github.com/amicojeko/YouCantTouchThis

Code: [Select]
/* A simple function to generate unique timestamp based filenames */

String uniqueFileName(String ext){
  String filename = "";
  p.runShellCommand("date +%s");
  while(p.running());

  while (p.available()>0) {
    char c = p.read();
    filename += c;
  }

  filename.trim();
  filename += "." + ext;

  return filename;


Thanks!

sonnyyu


Hi Kaul,

If you would like to add time stamp to your picture once you saving it, maybe this link able to help you :
https://github.com/amicojeko/YouCantTouchThis

Code: [Select]
/* A simple function to generate unique timestamp based filenames */

String uniqueFileName(String ext){
 String filename = "";
 p.runShellCommand("date +%s");
 while(p.running());

 while (p.available()>0) {
   char c = p.read();
   filename += c;
 }

 filename.trim();
 filename += "." + ext;

 return filename;
}  


Thanks!


Have time stamp at file name is nice idea. However you do not need ATmega32u4 help!

Code: [Select]
fswebcam test.png

Code: [Select]
fswebcam `date +"%G%m%d%H%M%S"`.png

It create 20140515123538.png  and has 2014/05/15 12:35:38  as time stamp.

http://linux.about.com/od/commands/l/blcmdl1_date.htm

sonnyyu

The time stamp is come from openwrt ntp which is required online all the time, but if offline support is is required then real-time clock (RTC) is needed.  However Yun masks all the GPIO which make direct connect RTC chip impossible. Very ugly work around is connect RTC via MCU.

khchan


FormulaArduino

ERROR MESSAGE LIKE BELOW. WHAT SHOULD I DO?

root@Arduino:~# cd /mnt/sda1
root@Arduino:/mnt/sda1# fswebcam test.png
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
Adjusting resolution from 384x288 to 352x288.
--- Capturing frame...
Captured frame in 0.00 seconds.
--- Processing captured image...
Unable to load font 'sans': libgd was not built with FreeType font support

Disabling the the banner.
Writing JPEG image to 'test.png'.

sonnyyu

Work around:

...
Code: [Select]
fswebcam  -i 0 -d v4l2:/dev/video0  --no-banner  --jpeg 95  --save test.jpg
--jpeg 95 will increase quality to 95%.
...


--no-banner


sonnyyu


...
recompile libgd with freetype support.

nano ~/OpenWrt-yun/package/feeds/packages/gd/Makefile

Code: [Select]
CONFIGURE_ARGS += \
        --enable-shared \
        --enable-static \
        --disable-rpath \
        --without-x \
        --without-fontconfig \
        --without-freetype \
        --with-jpeg=$(STAGING_DIR)/usr \
        --with-png=$(STAGING_DIR)/usr \
        --without-xpm \
        --without-iconv


remove " --without-freetype \" then recompile libgd. then remove installed libgd force install new revision one.  I have not chance to test it but you should go ahead try it yourself.


Go Up