2020-01-24

Create a custom fps timelapse from photos with ffmpeg

The simple version:
ffmpeg -framerate 60 -pattern_type glob -i "*.jpg" -s 1920x1080 out.mp4

The complicated version:
FPS=60 ; DURATION=$(echo 1/${FPS} | bc -l| sed 's/^\./0./') ; ffmpeg -f concat -safe 0 -i <(find /mnt/c/tmp/102MSDCF -name '*.JPG' -printf "file '%p'\nduration $DURATION\n") -c:v libx264 -preset slow -crf 18 -tune film -s 1920x1080 -vf setpts=PTS-STARTPTS -vsync 0 -r $FPS Desktop/test4.mp4

2018-03-17

What I don't like about the Samsung Galaxy S9

Introduction

Here is a short review of the Samsung Galaxy S9 after a few days of use.
The Galaxy S9 is a great device, it is fully featured and the build quality is impeccable. There are a lot of great things to say about it and you can get most of it by reading many online reviews. This post is about the things I do not like.

A bit of history (so you can understand my bias)

I previously owned a Galaxy S, Note 2 and S7

Some of you could say I've been a loyal Samsung customer. I in fact do not really care about brand loyalty and there is nothing I really like or want in the Samsung Touchwiz UI too. It just happen to be a succession of choices that I explain below:

Why did I bought the Galaxy S?

At the time, I was really curious about the AMOLED screen. The phone ended up having remarkable software bugs (like a shitty Filesystem...). It gave me a lot of experience flashing custom ROM and tweaking the software internal. I kept it until the Note 2 was released.

Why did I bought the Galaxy Note 2?

Back in the days I had a long commute: sitting about 50 minutes in a train every day, twice a day. So I wanted something I could watch videos on. I was also working as a consultant and having a decent sized device enabled me to use the phone instead of my laptop a few times.

Why did I bought the Galaxy S7?

I was frankly fairly happy with my Note 2 experience. It aged very well: what was a "phablet" (diagonal > 5") ended up being almost exactly what the normal phone would be a couple years later. The Galaxy S7 offered a decent battery (3000mAh), was waterproof, still had the microSD card option and had a surprisingly amazing camera. Two years ago, this phone was simply the absolute perfection. If you had asked me to write something negative about it, it would have been difficult!

So ... Why did I bought the Galaxy S9?

Samsung released the android Nougat update for the S7. I really didn't like the UI. The phone was became significantly less responsive. A few months later, the battery life started to decrease. After two years, the screen became little warmer (although still great) and the phone barely last a day on a single battery charge , even with a factory reset a minimal number of apps installed. I could have kept it another year but a $300 trade-in offer for the S9 made me do something crazy: pre-order the S9.

What I don't like about the Samsung Galaxy S9

Screen and Usability

Picture quality

I've been a big fan of AMOLED since day one (and there was a lot to improve...). But the technology is now mature and offer outstanding performance (for a couple years). Kudos to Samsung engineers for color calibration in the basic mode. Shame on the product folks for setting the colors to fluorescent by default. If you care about color fidelity, it will make your eyes bleed.

Also careful of the the OLED burning. This technology doesn't age well compared to LCD. If you are planning to use the phone with high brightness and always on (if you use it as a navigation device for instance): This screen will burn in: it will mark permanently. Even if you use it normally, after a couple of years, it will become yellow-ish, because the blue LED wears faster. That is something that you should know when you are buying an OLED display.

Screen ratio (bad)

Why 18:9 ? Why why why ?
- No content is available to this format.
- The phone camera itself as a very conservative 4:3 ratio. Displaying the pictures you have just taken will use only 66% of the screen!
- If the phone have had a 16:9 screen ratio, not only most of the content and movies would have fitted nicely but also the actual phone size would have been manageable with only one hand! (as the S7 used to be)

Ergonomy (bad)

There use to be two phones:

- the "normal" one ( < 5.3") that is usable in one (at least my) hand
- the phablet that needs two hands

...well now both Galaxy S9 and S9+ require two hands to be operated!

Rounded edges, beautiful lines, design and curves. "bezel-free" bullshit

There are few nice features with the edge display like the edge widgets. Yayyy, the bezel is so thin that you are now able to press random parts of your screen just by holding a device. Also it get slippery and you most likely going to buy a good old thick $7 rubber case to cover your $800 phone. Congratulations! How is the bezel now?

You chose not to wear a protective shell? I personally haven't dropped my phone more than twice a year with the shell, I've dropped it almost every day without a shell. Glass and metal grip varies a lot according to the environment and the moisture of your hands.

Biometrics

Biometrics works (surprisingly) pretty well. Without all the iPhone X next gen components, I would have expected the Face unlocking to be pretty useless. However it looks like combined to the iris scan, they do a decent job, even at night, cycling and the phone under heavy rain, it was able to unlock fairly quickly. Only caveat is that it looks like the screen brightness increase while using Smart unlock (probably to maximize the chances of successful face recognition) which is not nice when you are in a dark environment. I might just go back to the fingerprint unlock for the reason.

Super slow-mo

The focus is difficult to make. Please add a manual focus option Samsung and please do not add this shitty music on my footage

Conclusion

Should have I upgraded from the S7 to the S9? NO, this phone is less usable and I should have kept my S7 and kept looking for a better alternative, without curved edges, without notches. Probably another brand, or maybe the S9 active ?

2017-07-22

2016-11-01

Sricam SP009 in VLC

Best quality stream
rtsp://[Sricam_IP]:554/onvif1

There is also a 320x180 low resolution stream available (might be enough for motion detection
rtsp://[Sricam_IP]:554/onvif2

Disable night IR mode on Sricam SP009


I recently bought a Sricam on Amazon just to see what you can have nowadays for £30. After all, not so long ago the only (in)decent thing you could have for 8 times the price was the D-Link DCS-950G. Ewww what a disgusting piece of hardware... and software. Glad those days are over !


I set it up to look outside on my front yard. When the night comes, the camera switch in infrared mode and the 8 IR-LED will blast light as far as a couple of meters. The picture is then black and white. Honestly it works pretty well.

The problem is that the camera is behind a window and most of that IR light is reflected by the glass right in front of the sensor, making it completely blind. I've tried to put tape on the outer circle of the camera where the LED are located but then the light sensor used to detect night mode will be covered as well, telling the camera to switch to infrared mode anyway. the picture will then go black and white even if sun is shining

So I decided to open it and do something. I didn't really had a plan in mind, ripping off the IR LED could have been a good solution.

Removing the 4 screws reveals a nice PCB with the main SoC, as well as some power regulator components, the SD card slot and the green wifi chip. The two big wires are connected to a "speaker"

An additional screw maintains the outer circle and it's 10 diodes.

I'm wondering if Sricam engineers just copied dropcam design or geniunely designed this, but anyway the result looks legit.

Luckily I found out a photodiode used as a light sensor, surrounded by a 8 IR and one red status LED. Covering the sensor opens the circuit and putting it in front of a bright light closes it.


By following the path on the board, we can see that pin 3 and 4 are connected to that diode.

So I've cut part of a leg of a resistor (5mm long) and shaped into a U-shape.

Put it on the connector itself between pin 3 and 4 et voilĂ :

I'm very happy with my camera now and even at night I get a clear color picture, thanks to the street lights !

2016-04-17

Redirect all your subdomains to a single https domain with nginx

On my playground server, I run a bunch of services in docker containers.
Most of them uses HTTP but don't natively support HTTPS so I'm using nginx as a front web server / reverse proxy to secure the connection.

I like to access my services using the following notation:

  • service1.example.com
  • service2.example.com

In fact, they all point to the same host and I'm using the DNS A records @ and *

The thing is, if I want to enable HTTPS for all these subdomains, I need as many legit SSL certificates. Another option is to buy a wildcard certificate but it's rather expensive ... for a playground server.

So I wrote this handy nginx config which permanently redirect HTTP requests to one unique HTTPS host:

  • http://service1.example.com => https://example.com/service1/
  • http://service2.example.com/path => https://example.com/service2/path

It also supports

  • http://example.com => https://example.com//


Ideally I'd get rid of the double trailing slash, but it'll work for now. Let me know if you have suggestions, this could certainly be enhanced


server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    # Match domain.tld or prefix.domain.tld
    server_name ~^(?<domain>[a-z0-9]*\.[a-z0-9]*)$ ~^(?<prefix>[a-z0-9]*)\.(?<domain>[a-z0-9]*\..*)$;

    error_log stderr;

    location / {
        rewrite ^ https://$domain/$prefix$uri permanent;
    }
}

Popular posts