Monday, January 18, 2016

Create Time lapse with FFMPEG and Windows

A recent project I worked on was to create a time lapse of the building of my brother in-law's house. The camera itself was basically a Raspberry Pi that was set up to take a picture every half hour from 6 am to 9 pm. This was accomplished with a simple cron script that ran based on the time of the system clock. There was some drift because it was not connected to the internet and could not get any information from NTP. So it was all based on the time that was set after booting, and since it was powered by a solar panel and battery it could be set up for 3 months without interruption. The only downside was that the 16GB USB stick could not store all the photos for the entire time the camera was taking pictures. It also acted as an access point with a WiFi card so you could SSH into it and monitor the photos folder or download some images without having to take the camera down.

When it was finished, there were a total of 6145 photos, spanning just a little under six months. I found the easiest way to create a time lapse from that many images was to use FFmpeg. It works a little different on windows as it does on Linux, because it doesn't actually install anywhere and it is just an archive file that gets extracted. After downloading, it placed it in a folder called tools on the C:\ drive and opened the command prompt in C:\tools\ffmpeg\bin. (Note the bin folder... That is where the executable for FFMpeg is.)

The command to compile the video was:

C:\ffmpeg\bin>ffmpeg.exe -f image2 -framerate 15 -pattern_type sequence -start_number 0001 -i C:\Images\IMG_%04d.jpg C:\Output\video.avi

-f image2 is the input format
-framerate 15 is setting the video at 15 frames per second
-pattern_type is for using filenames matching the glob pattern set in -i
-start_number is telling FFmpeg to start at image number 0001
-i is the input files, with %04d setting the number with four digits

At the end of it all, I had a pretty nice 5 minute time lapse at about 300 MB in size.


Sunday, January 17, 2016

CentOS 6 Network Configuration

After installing CentOS 6.7 eth0 would not be listed in the output of the ifconfig command. This is because in /etc/sysconfig/network-scripts/ifcfg-eth0 the ONBOOT variable is set to no. If this is changed to yes, and the network service is restarted eth0 becomes active.

Example:

#vi /etc/network-scripts/ifcfg-eth0

DEVICE=eth0
HWADDR=[mac:address]
TYPE=Ethernet
UUID=[some long number]
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=dhcp

Once these changes are saved, then restart the network service with:

#service network restart

If using DHCP, then CentOS can now be updated and other tools can be installed.

Thursday, January 14, 2016

SonicWall Console Cable





Launch a terminal emulation application that communicates with the serial port connected to the appliance. Use these settings:
• 115,200 baud
• 8 data bits
• no parity
• 1 stop bit
• no flow control
Press Enter/Return. Initial information is displayed followed by a DEVICE NAME> prompt.

Exctract Acrobat MSI

Steps to extract the Adobe Reader MSI installation files from the compressed executable:
1. Obtain Adobe Reader from adobe.com: http://get.adobe.com/reader/ and save the file to your desktop.
2. Choose Start > Run.
3. In the Open text box, type: "%UserProfile%\Desktop\AdbeRdr80_en_US.exe"
4. Click OK.
5. When the Adobe Reader Setup screen clears, choose Start >  Run.
6. In the Open text box, type: %temp%
7. Drag the Adobe Reader folder to your desktop.
This folder contains AcroRead.msi and Data1.cab files needed for installation.
Update (thanks to the comment from V23 below)
For Adobe Reader X, the setup files will be extracted to a folder in:
  • %ProgramData%\Adobe\Setup (Windows Vista and above)
  • %ALLUSERSPROFILE%\Application Data\Adobe\Setup (Windows XP / Windows Server 2003)
If you wish to define where the files will be extracted, use the -nos_o switch as follows:
AdbeRdr1010_en_US.exe.exe -nos_o"C:\Folder" -nos_ne
Replace C:\Folder with the path to a local valid folder.  Please ensure the folder is empty as otherwise the existing files and folders may be overwritten/deleted.