Tuesday, March 2, 2010

From DV to Vimeo on Linux

Short summary of "how to get a movie from DV camera to Vimeo on Linux" (after several tries with 16:9 format rendered as 4:3 :-)).
Download data from camera (used Firewire port and Kino). Only needed thing was to load raw1394 module and add permissions to r/w to /dev/raw1394 before launching Kino.
Exported movie as DV-AVI (type 1).
Converted the resulting AVI to H.264 (and rescaled it on the way).
mencoder -profile vi -aspect 16:9 -vf scale=848:480 $1 -o $2
Here the vi profile refers to a section in ~/.mplayer/mencoder.conf:
[vi]
profile-desc="Lo-quality x264 video with aac"
vf="pp=ci"
ovc=x264=yes
oac=lavc=yes
lavcopts="ac3"
x264encopts="threads=auto:subq=6:partitions=all:8x8dct:me=umh:frameref=5:bframes=3:b_pyramid:weight_b:qp=30"
Value of the qp parameter in x264encopts determines quality - the lower, the better (and larger file). In general 10 seems very nice, 30 acceptable for not-so-hi-quality source.

Actually - the size it's rescaled to should probably be chosen better...

Tuesday, January 19, 2010

Playing with Selphy CP530 (and not really amused)

Selphy printers are small, cheap to get and not that expensive to use. In addition, there are are no inks that would dry when you don't use it for few days. Why is it cheap? Color space of the printer is very poor and there's no support for color management - so except for special types of images you are going to need more then one paper to make the result look acceptable (and in many cases even that is not going to help).

Tuesday, January 12, 2010

Sky - long exposure

I tried to make an exposure of a night scene - so long that the stars would turn into arcs of light. Results are below - I think that I at least got some ideas how to do that right.

First - how long the exposure should be to get a reasonable effect? If the stars rotate 360 degrees in 24 hours, that makes 5 degrees in 20 minutes. That should do.
Canon 400D has exposure time limited to 30 sec unless in bulb mode. Bulb mode only makes sense if you have remote shutter trigger - you can surely hold the shutter button 20 minutes, but there's no way the image will be sharp. After several tries to securely lock the trigger mechanically, I reverted to 30 sec exposures, expecting to combine them later. As 30 sec would probably result in some sensor hotspots, I turned the long exposure noise eliminitation on, took some spare clothes and spent half an hour half sleeping and half pressing the button.

As a result I got 21 images with ISO 100, F3.5, on a 16 mm equiv. lens, spaced ~1 min in time from each other - 30 sec exposure, 30 sec noise elimination exposure, write, my wake up time.
After 10 frames the battery died and the image got slightly shifted, so I only used the remaining ones/second part of the series.


This was created by loading the images as layers into Gimp, turning the overlay option to Lighten only for each except background layer and tuning the curves slightly. As you see, the stars and clouds move - but stars turn into dots, not arcs...

Just to try I also fed the same images to Picasa's Collage option. Here you get more blurred image, against with dots for stars, but the merging seems to be done in a smoother manner. Maybe just sum of 1/n weighted matrixes?


Anyway, what might work better for the given set of stills is to combine them into a video.
This was done in mencoder using:

mencoder mf://*.jpg -mf type=jpg:fps=5 -ovc x264 -x264encopts crf=5.0 -noaspect -o a.avi





Next time:
  1. Take the remote trigger with me :-)
  2. Replace the battery in camera before shooting to make sure it will last when it's freezing around.
  3. Try withouth long exposure elimination, so we'll get lines, not separate points.
  4. Try with stopped down lens and noise elimination for a time like ~10 or 15 minutes.
  5. Try clear sky without the moon and (especially) without clouds

Saturday, November 28, 2009

Synology network backup - how is it implemented?

There's a "Backup to remote rsync-compatible server" option in the Synology Disk Station 2.2 firmware. Question is - how to really use it and how is it implemented? How about security and accounts? Can anyone use the rsyncd? Those are some questions for start...

Once you enable the "Network backup service", one more share is created in the "Shared folders" --- there's a NetBackup share now. You can also use the GUI to modify access to the folder based on uid/gid. As there is the option to "use rsync compatible remote server" let's look around for the rsyncd cfg files on the DiskStation (via terminal access).

There's an /etc/rsyncd.conf and /etc/rsyncd.secrets. The rsyncd.secrets lists root with a password hash, the configuration file lists NetBackup rsync module with root user allowed to login. There's a rsync process running as a daemon on the station.

The default setup of the station therefore only allows root user to connect via the normal rsync remote method (no ssh) to the NetBackup module. No data encryption, MD4 based challange-response authentication and the GUI settings aren't reflected in the configuration files --- they only alter the filesystem permissions.

This is ok for a closed network setup --- but questionable on an open network.

Monday, September 7, 2009

JabRef settings

To get JabRef generate keys as ijrb80_251, that is "lower case abbreviation of the journal name, volume and first page of the publication", set Key pattern to [journal:abbr:lower][volume]_[firstpage].

Friday, August 21, 2009

DVD authoring under Linux

The goal was to make a DVD from short videos captured on two digital cameras and some pictures. Although it's rather easy to do today, the tools available still do have some rough edges.

System used: Ubuntu 9.04 with the Ubuntu Studio extensions on x86_64 platform.

General steps to do were:
  1. Get videos from camera to computer
  2. Cut out the right parts, working losslessly
  3. Convert the parts into a MPEG2 DVD compatible files
  4. Create parts with titles, texts, image slideshows
  5. Create DVD menu and burn the whole thing.
Getting the source videos
One camera directly generated MPEG2 files on its internal SD card.
The second one had a Firewire DV output. This can be handled using Kino easily, it was only necessary to load raw1394 module and adapt permissions of /dev/raw1394. The output, saved as AVI was then already viewable in Totem.

Cutting out the right parts
I used Kino, otherwise Cinellera or kdenlive are very helpful.

Getting DVD-style MPEG2 files
Video DVD content is split into files - "Titles" and those can have bookmarks, called "chapters". To get one file per title it was necessary to deinterlace and convert the DV AVI files into MPEG2-PS, deinterlace the MPEG2 files from the other camera and join them. In this case I didn't care about transitions between the joined files.
I used tovid for deinterlacing and doing the conversion. Only problem is that the conversion is painfully slow (several hours on my hardware).

tovid -force -deinterlace -dvd -pal -wide -parallel -in $INFILE -noask -out $OUTFILE

The -force was to make tovid deinterlace the MPEG2 files from the SD-card camera.
Resulting .mpg files can be joined using mencoder easily:

mencoder -of mpeg -ovc copy -oac copy -mpegopts format=dvd:tsaf -o $OUTFILE $SOURCEDIR/*.mpg

Titles
There was need to get just some still slides with text. The most convenient way for me was to generate the stills in inkscape - 720x576 bitmaps with text,, graphics, whatever you need, and then convert them to the MPEG2 using dvd-slideshow.

DVD Menus
There are several programs available, DVDStyler seemed most versatile. Only bad thing for me was that the buttons it renders have aliased fonts and look very ugly. As a workaround I described the menu items as normal text and used a simple arrow image as cursor/selector.

Of course, once you compile the whole thing, you find that you are some 100 MB over limit :-) But that can be expected...

Monday, August 10, 2009

Travelling in Poland with a dog

This is a short summary of what I think might be useful if you plan to travel with a dog to Poland - we just got back after walking some days along the north coast.

All following bans have to be interpreted in context - it depends on the situation and the dog whether they will be enforced or just silently ignored.

General notes
The dog has to be kept on leash (na smyczi) everywhere unless specially permitted. Mostly respected, especially in cities. But if the dog is friendly, people usually don't say anything. Some breeds are considere aggressive (officially), those have stricter rules.

On the coast we've me mostly german shephard dogs, yorkshires and golden retrievers. From time to time there was a pit bull terrier - with a muzzle and on a short leash.

Transport
There are two main transport companies - PKP trains and PKS busses, then there are multiple local bus companies. We had no experience of dog not being accepted. Unless you travel in a crowded busses it is usually even ok without the muzzle/kaganiec. Often the dog is silently ignored by the driver (no need of ticket) in busses.

We've been told by Polish people that we can just travel without the dog ticket even in trains, but we haven't tried that. In trains the dog pay either 4 zloty or 15 zloty (EC/IC), in busses they travel free or pay like children.

If you plan to travel in a couchette or sleeping wagon, you have to (in theory) buy the whole coupe, that is six places for a couchette or three for a sleeping car.

Beaches/Coast
On guarded beaches the dogs are allowed only to pass through not to stay there and they should have a muzzle and be on a leash. On wild beaches it's ok just to keep them on the leash. In reality there are dogs everywhere, even on guarded beaches and it's just on a common sense to keep or not to keep them on the leash when outside the guarded beaches. As long as you keep it under control and it does not endanger somebodys children it's usually ok. People and children mostly interact well with the dogs, fairly often the children run to the dog to hug it.

In Slowinski National Park the dogs are strictly forbidden on the beaches. In reality you can argue that there a trail on the beach - so you can walk there. We discussed this with the guards and they just asked us to leave the beach on the first exit. Possible reason for this ban are foki/seals that sometimes come here - the dogs will disturb them.

Food
There are shops with things for animals in every small city and it's sometimes possible to buy raw meat. Fish is available everywhere along the coast. People generally do ask you before feeding your dog with something.

Shops/restaurants
Mostly no dogs allowed.