How to assemble timelapse In 2002-2005 I collected approx 280000 jpegs from a webcam that updated every 5 minutes, with pictures of a construction job in my local town. 

My goal is to make a youtube-video with optimal quality.

Can I do this with free software? How many fps should I have? What codec? 

Here are two consecutive original images.

trondal.com/a.jpg

trondal.com/b.jpg
Assuming these have, or can be given, consecutively numbered file names you can do this easily using ffmpeg, avconv and similar utilities. Most have builds for Mac, Windows and Linux.

The choice of frame rate is up to you, and really affects only the total length of the output file (at 30fps, 280000 frames is 2.6 hours; at 24 fps it's 3.24 hours). If you have a target device or platform that needs a specific rate, use that.

You may want to decimate the source stack -- that's a lot of pictures and it's unlikely to be interesting for the entire length. I would convert to 30 fps, then edit the result to eliminate long unchanging sections (nights, etc).

Good luck.