Bear Park (Bärenpark) Bern has set up a Webcam in one of the winter dens of one of their bears, Björk.

This web cam was just a static image that changes every half minute or so. When I discovered this sometimes in January I started saving that image every 30 seconds and have been doing that for 2 months now. I have over 182'000 snapshots of that camera (over 5.4 GB). I compiled them into this video. Using I figured at which times it is dark, so I removed all these photos.

Their hibernation period has now ended and they're outside more often.

Bear sleeping in the sun

This is the script I used to compile the video:

set -e
cd ~/drive/bear-webcam
rm -f output/input.txt
mkdir -p output/
dates=`find -name 'baerenpark*' -type f -printf "%TY-%Tm-%Td\n" | sort | uniq`
for day in $dates;do
    echo "seeing if $out needs updating"
    sun=`curl -s "$day"`
    sunrise=`echo "$sun"|jq -r .results.civil_twilight_begin`
    sunset=`echo "$sun"|jq -r .results.civil_twilight_end`
    files=`find -name 'baerenpark*' -type f -newermt "$sunrise" ! -newermt "$sunset"|sort -V`
    if [ -e "output/$out" ];then
        for f in $files;do
            if [ "$f" -nt "output/$out" ];then
                rm "output/$out"
    if [ ! -e "output/$out" ];then
        cat $files | ffmpeg -f image2pipe -vcodec mjpeg -i - -c:v libx264 -r 30 -pix_fmt yuv420p output/$out
    echo "file '$out'" >> output/input.txt
rm -f output/bear.mp4
ffmpeg -f concat -i output/input.txt -c copy output/bear.mp4