Latest Publications

FreeBSD and unexpected addresses on the wrong interface

Beastie from FreeBSDIf unexpected packets arrive at the wrong interface, then the FreeBSD operating system will fill the system log with messages like the following. These messages will also fill the security output and kernel log messages.

arp: 192.168.1.1 is on lo0 but got reply from 00:19:cb:f9:12:34 on xl0
arp: 192.168.1.1 is on lo0 but got reply from 00:19:cb:f9:12:34 on xl0
arp: 192.168.1.1 is on lo0 but got reply from 00:19:cb:f9:56:78 on xl0

In order to turn logging of these packets off, use the following procedure.

su -

Confirm, that logging of these packets is turned on.

sysctl -a | grep -i net.link.ether.inet.log_arp_wrong_iface

If the result is 1, it is turned on. Turn it off.

sysctl net.link.ether.inet.log_arp_wrong_iface=0

Turn it off permanently.

nano -w /etc/sysctl.conf
net.link.ether.inet.log_arp_wrong_iface: 0

Command line video editing with FFmpeg

ffmpeg-logoFFmpeg is a complete, cross-platform solution to record, convert and stream audio and video. It includes libavcodec, which is the leading audio and video codec library. FFmpeg is free software. FFmpeg has good documentation in their homepage. Howard Pritchett wrote a good article with examples.

In this example we want to join sequences from video clips from a Sony Handycam SX-30 DVR into a single video, that has the same properties as the original video clips. The Sony Handycam DCR-SX30 is a digital video recorder (DVR), that stores video clips in the MPEG program stream (PS, MPEG-PS) container format, that multiplexes one digital video channel and two digital audio channels. The video channel is MPEG-2 at a 16:9 wide screen frame resolution (dimension) of 720 x 576 pixels at a rate of 25 frames per second (fps). The digital audio channels is Dolby Digital (AC-3) at a sample rate of 48 kHz and 256 kbps.

Play each clip in a movie player, such as MPlayer. Turn on the on screen display (OSD) by pressing O. Note the position and length of each scene. The position is the timestamp in the HH:MM:SS form. The length is the amount of time from the position in seconds. If, for some reason, the OSD timestamp does not begin at 00:00:00, you can calculate and note the position is seconds instead.

Clip       Position  Length  Comment
clip1.mpg                    All
clip4.mpg            10      10 sec from the beginning
clip6.mpg  00:20:15  30      30 sec from 20 min and 15 sec

Create the scenes. Specify the position and the length of each scene. Specify the clip. If clips are interlaced, then deinterlace them by specifying the “deinterlace” option. Specify the scene. Do not use the “sameq” option. It should give the same quality as the source clip, but it actually gives a crappy result. Do not use the “copy” codecs. They do not work.

ffmpeg -i clip1.mpg -target dvd -deinterlace scene1.mpg
ffmpeg
-t 10 -i clip4.mpg -target dvd -deinterlace scene2.mpg
ffmpeg
-ss 00:20:15 -t 30 -i clip6.mpg -target dvd -deinterlace scene3.mpg

Concatenate the scenes using cat. This will join the scenes into a single concatenated container. This is also known as combining or merging.

cat scene* > concatenated.mpg

Correct the timestamps in the container.

ffmpeg -i concatenated.mpg -target dvd final.mpg

Other:

Convert from 3gp to MPEG.

ffmpeg -i input.3gp -sameq output.mpg

Convert from 3gp to MPEG and remove audio.

ffmpeg -i input.3pg -sameq -an output.mpg

OpenShot Video Editor for Ubuntu 11.04

OpenShot Video EditorIn this article, we will test the OpenShot Video Editor, that is available in the Ubuntu Software Center in the Ubuntu 11.04 operating system. The purpose of the test is to prepare video from a Sony Handycam DCR-SX30 video camera for the YouTube video website.

The Sony Handycam DCR-SX30 is a digital video recorder (DVR), that stores video clips in the MPEG program stream (PS, MPEG-PS) container format, that multiplexes one digital video channel and two digital audio channels. The video channel is MPEG-2 at a 16:9 wide screen frame resolution (dimension) of 720 x 576 pixels at a rate of 25 frames per second (fps). The digital audio channels is Dolby Digital (AC-3) at a sample rate of 48 kHz and 256 kbps.

We install OpenShot Video Editor from the Ubuntu Software Center.

The neat and promising homepage of OpenShot Video Editor recommends, that we install codecs, that are not installed by Ubuntu per default. These are called “libmp3lame” and “libx264″. We follow the recommended guide, open the Synaptec Package Manager, search for the “libavformat” and mark “libavformat-extra-52″ for installation. A dialogue appear and we confirm, that additional packages will be installed. This includes the “libmp3lame0″ and the “libx264-106″. We apply the changes and close the Synaptec Package Manager.

We open OpenShot Video Editor from the main menu. The interface looks neat and simple. However, it does occupy a lot of CPU power. We go through the properties and change the default profile to “DV PAL Widescreen”. We load two video clips, drag one into each track, cut as necessary, add transition effects as necessary and add other effects as necessary. The preview is not smooth.

Unfortunately, when we want to save the project, OpenShot Video Editor hangs. Very unfortunately, OpenShot Video Editor hangs before writing to the file. This means, that all work are lost. Failure to save work is by no means acceptable in a late version of any software.

A quick search on Google reveals, that OpenShot Video Editor is known for hanging in many ways. The website of OpenShot Video Editor does not even have a mail address. This could indicate, that the programmers are not interested in producing stable software nor respect the time and work of users.

OpenShot Video Editor can not be recommended for any use by any one.

Ubuntu 11.04 and enhanced desktop effects

CompizIn the Ubuntu 11.04 operating system, enhanced desktop effects can be achieved with a composite window manager.

Compiz is a compositing manager, which means, that it enhances the overall user interaction by adding fancy effects to your windows – from drop shadows to awesome desktop effects like the well known Desktop Cube or the Expo view. Compiz can also be a window manager, which means, that it is the software between you and your desktop windows. It enables you to move or resize windows, to switch workspaces, to switch windows easily (using Alt+Tab or so), and so on. Compiz Fusion is the result of a merge between the well-known Beryl composite window manager and Compiz Extras, a community set of improvements to the Compiz composite window manager. Compiz Fusion aims to provide an easy and fun-to-use windowed environment, allowing use of the graphics hardware to render each individual window and the entire screen, to provide some impressive effects, speed and usefulness. Compiz is an open-source software project, meaning anyone can use it freely and contribute.

Open the Ubuntu Software Center, search for CCSM and install the Advanced Desktop Effects Settings (ccsm).  Go to the menu, go to “System”, go to “Preferences” and start the CompizConfig Settings Manager.

Go to “General”. Open “General Options”. Configure the number of virtual desktops. If you have a netbook or a small screen, you might want to have more rows, so larger windows can be handled. Enable “Gnome Compatibility”. Now, you can open the menu with Alt+F1, run a command with Alt+F2, open a terminal window with Ctrl+Alt+T, make a screen shot with PrintScreen and a window shot with Alt+PrintScreen.

Go to “Accessibility”. Enable “Enhanced Zoom Desktop”. Open it. Enable mouse “Zoom In” for Super+Button4 and mouse “Zoom Out” for Super+Button5. Now, you can zoom in and out with Super and the mouse roller. Enable “Opacity, Brightness & Saturation”. Now, you can make a window transparent with Alt+MouseScroll. Enable “Show mouse”. Now, you can always find your mouse pointer with Super+K. It will be surrounded by magic stars.

Go to “Desktop”. Enable “Desktop Wall”. Now, you can switch between desktops with Ctrl+Alt and arrow keys. Enable “Expo”. Set “Expo key” to Super+E. Now, you can view all desktops with Super+E.

Go to “Effects”. Enable “Paint fire on the screen”. Now, you can set parts of the screen on fire with Shift+Super+MouseLeft and put it out with Shift+Super+C. Enable “Window Decoration”. Enable “Wobbly Windows”. Now, you can wobble a window when moving it and snap a window to another window with Shift while moving it.

Go to “Extras”. Enable “Screenshot”. Now, you can press Super and use the mouse to select an area on your screen, that you want to store as an image file on the desktop.

Go to “Window Management”. Enable “Shift Switcher”. Now, you can switch between the windows on the desktop with Super+Tab and Super+Shift+Tab.

Ubuntu 11.04 and desktop zoom

Open the Ubuntu Software Center, search for CCSM and install the Advanced Desktop Effects Settings (ccsm).  Go to the menu, go to “System”, go to “Preferences” and start the CompizConfig Settings Manager. Go to “Accessibiliy” and find Enhanced Zoom Desktop. Make sure, that it is enabled. Open it. Enable mouse “Zoom In” for Super+Button4 and mouse “Zoom Out” for Super+Button5.