Here I aim to outline any projects I undertake because I wanted to make a funny little blog.
Not written yet, see the others
kinda want to eat food but the site one is done :)
To be breif, this website is NGINX, static HTML + CSS files(I hate PHP), and a Gstreamer command run by a systemd unit. But brief is not what you're here for.
As you can see, I take very good care of my hardware. I run the site on a Jetson Nano I bought 4 or 5 years ago that is tossed in a corner next to a network switch. Its probably not a good idea, but its been fine for years so there it will stay. It sits at an awkward position within USB range of the random camera + whatever sensors(coming soon teehee) I use for the fish tank. Do I perform backups of this system? Nope, if it corrupts the site is gone!
I opted to use NGINX for the webserver as I started out with zero knowledge of HTTP servers and it seemed a rather popular choice. Since I'm using a Jetson Nano I'm just using the Ubuntu package that I update whenever the SSH prompt reminds me to. I set up Certbot as well because I'm not gonna be caught with an expired SSL cert no sir!
I chose to prohibit myself from using any of those huge JS and CSS libraries (except VideoJS since I am NOT doing that from scratch) like Bootstrap by Twitter, since I figured it'd make learning the basics harder as I'd have to debug somebody else's code. I made excessive use of server side includes so I didn't need to copy and paste headers and such. Cool stuff, unfortunately it means that I can't test changes out of production unless I set up a local nginx server which I haven't really needed to do. I tried to go for a "good enough" look; I'm a CS major so I'm no artist anyway. Oh yeah I use cloudflare too, might as well since it's free and can help limit the load on my home network a little bit with caching.
For the part you've all been waiting for, the abomination that is the fishcam. Check out the command that streams it.
gst-launch-1.0 v4l2src ! video/x-h264,width=1920,height=1080,framerate=30/1 ! omxh264dec ! omxh264enc bitrate=15000000 ! h264parse ! mpegtsmux ! hlssink location=/home/warren/site/pogfish/stream/segment%05d.ts playlist-location=/home/warren/site/pogfish/stream/playlist.m3u8 max-files=4 target-duration=1 sync=false
Are you supposed to use gst-launch for this? Nope. Did I? Yup. Did it work? You bet! I have little trust in this being stable but it seems to function so I ask no questions. It stores 4 segments of 1s and the video files are served exempt from cache to the client. As of now, the Fishcam is locked to 1080p30, but I'd like to add a quality selector for lower quality streams since it struggles to work on mobile clients. Mobile clients suck for many other reasons but this sure is one of them! For some reason, my smart one year ago self opted to make an entire text file that is served to the client with a Y or N denoting whether to load the stream of the sleeping image. Whatever, it works. I've recently also added a cron script that re-encodes a random .ts file to .mp4 and serves it as a video embed using the Open Graph Protocol for clients in discord/iMessage. Sadly caching makes this mostly worthless.