Posts Tagged ‘convert’

Pictures to movie: A simple example of avconv

Sunday, February 17th, 2013

In 2011, I travelled from 豊岡 (Toyooka) to 京都 (Kyoto) by train. Every couple of seconds I took a picture with my camera. Since then, I wanted to merge all these pictures into a movie, if possible with some music.

I tried the better known video editors such as OpenShot Video Editor, Pitivi Video Editor, Blender and such but never really got far. Either pictures couldn’t be mass imported or they couldn’t be distributed evenly etc. etc.

Finally, a friend mentioned ffmpeg last week so I tried it again. Unfortunately, ffmpeg seems to be deprecated but they recommend to use avconv instead which comes with “libav-tools”

Format converting is an art of its own, but if you just want the basics, all you need is the following command:

avconv -f image2 -r 3 -i ./%04d.JPG -i soundfile.wav -c copy -crf 20 output.avi

Run this from the folder where your *.JPG pictures are and you will get a movie “output.avi” including a soundtrack from soundfile.wav. “-r 3” means 3 frames per second, so play around with this value if you a ‘faster’ or ‘slower’ movie.
Something else to keep in mind: The pictures must be named in numerical order: 0001.JPG, 0002.JPG etc.
If you don’t have your pictures named like that, try this command (all on 1 line in the terminal):
i=0; for f in *.JPG; do ln -s $f $(printf “%04d.JPG” $i); i=$((i+1)); done
This will create symlinks for all .JPG in your folder in the order that `ln -s` would output them.

This is the result: The final video

As usual, a couple of simple examples in the man page would have been helpful.

Don’t let Banshee scare your removable device!

Sunday, October 9th, 2011

As you might know, Banshee replaced Rhythmbox as default media player in Ubuntu as of 10.10. Apart from being written in Mono (which I consider a weak point), Banshee is a more temporary media player with support for many portable media players and online stores.

I sport a Transcend MP860 which I described in one of my earliest post. So far, I was just manually copying files to and back to the device using the shell or Nautilus. It works but I wanted to see whether I can use Banshee for that as well, since my music collection of 5800+ songs is already being managed by Banshee.

The first couple of tries were not succesful. Dragging folders from 1) to 2) didn’t work as I was hoping.

Dragging folders from 1) to 2) didn’t work

Banshee would start converting the .ogg files to .wav files. As the MP860 can play .ogg files, no conversion should be required.

The context menu of the device in Banshee was not helpful either: right-clicking the “8.0 GB FileSystem” and selecting “Device Properties” does supposedly allow you to change settings, but in my case only .wav was available.

As so often, Google to the rescue! Sometimes it’s frustrating though. Nothing but bug reports about format conversion problems or promising hints that end in 404 error pages. Fortunately, I found another post that treats a similar sort of problem with Banshee and removable devices. The steps outlined in that post helped me fix my problem. I will show you what I needed to change to fit it my requirements…

Below is a screenshot of my MP860 when I connect it via USB to the pc:

The directory structure on my MP860

These are the default directories and the MUSIC folder contains my audio files in a two-tiered structure e.g. <band>\<album>

Now, in order to make Banshee recognize the MP860 player as a media player that’s capable of playing .ogg files, I needed to touch the following file in the root of the MP860:

cd /media/disk (<– your player might be mounted with a different name)
touch .is_audio_player

Fire up your favourite text editor and edit .is_audio_player to contain the following lines:


It’s probably self-explaining, but here you are:
The first  line must contain the path to your music files.
The second line… I actually don’t know. My directory structure is two levels deep… I have no idea where Banshee would copy files if the folder_depth were 3.
The last line specifies the output format that your player knows. If the file format in Banshee matches the output format specified in that line, no conversion will take place. The files will just be copied. In his post (see the link above), Activ8specifies several non-ogg formats, separated by a comma. Check out his post for the exact syntax or feel free to experiment!

HTH some.