Transcoding GeniCam to HLS


Goal: GeniCam cameras output Bayer format raw video. We need HLS H.264.
Hardware setup at MaxxSports:
Camera connects to a low end Windows laptop by a 3 foot USB3 cable. Laptop is not capable to encode 1080p video, and it sends the raw video to a Linux server through optical fiber LAN.

The general flow:
In house Windows OpenCV application, mux.exe, reads and process the raw video from camera, and pipes it to ffmpeg.
ffmpeg sends raw video to ffserver through http.
ffserver encodes it into H.264, and expose a RTSP end point.
ffmpeg re-packages RTSP into HLS, and exposes it as a http URL.

Sample commands listed as following:
Raw video processing: mux.exe
Send raw video to ffserver:
mux.exe | ffmpeg.exe -re -f rawvideo -vcodec rawvideo -s 1920×1080 -r 30 -pix_fmt            bayer_rggb8 -i pipe:0 -g 1 http://awsq.MaxxSports.cc:555/feed.ffm
ffserver.conf parameters:
HttpPort 555
RtspPort 554
File /mnt/ebs/ffbuf/feed.ffm
<Stream bvsc.mp4>
Feed feed.ffm
Format rtp
VideoCodec libx264
Re-package from RTSP to HLS
ffmpeg -i http://awsq.MaxxSports.cc:554/bvsc.mp4 -f hls -hls_segment_filename /mnt/ebs/strm_%05d.ts -hls_time 6 -segment_list_flags +live -hls_list_size 12000 -hls_flags delete_segments -start_number 0 /mnt/ebs/strm.m3u8

Final HLS output URL:  http://awsq.MaxxSports.cc/strm.m3u8

Advertisements

SSL Cert Installation


Installed SSL certificates in two ways, free and paid.

Free: Letsencrypt.org as example
Download and run certbot file “letsencrypt”. cert only valid for 90 days.
Basic steps:
Make .cnf file
Run “openssl req” with the .cnf file to create CSR Certificate Signing Request .der file
Run “letsencrypt certonly” with the .der file to get the cert downloaded
During this process, create text file on web site to prove ownership

Paid: Ssls.com as example
$140 for two years with wild card support.
Instead of running certbot file, interact with web site, which is easier
Of course, creating file on web site is required to prove ownership

Copy the cert and private key file to web server, and update config file.
For nginx, as an example, they are ssl_certificate and ssl_certificate_key.

To confirm cert installation:
Using Chrome:
Developer Tools – Security, enter URL in address bar, click View Certificate button.
Using Online tool:
Just replace the hostname in the URL below.
https://www.sslshopper.com/ssl-checker.html#hostname=https://maxv.maxxsports.cc:443

sslsorder

Team Eenvironment Setup


Here are some team environment I have worked with, some with MaxxSports.

Version control: git(gitlab or github), svn, perforce, MS Team Foundation
Code review: Codeflow, Swarm
Issue Tracking: Jira, Bugzilla
Task tracking: Jira
Email: Gmail Business, AWS WorkMail, MS Exchange
Messaging: Slack, Lync
Conference: G Suite Hangouts Meet meet.google.com, bluejeans,
Wiki: Confluence
File sharing: Box
Build Management: Teamcity, Jenkins, MS Team Foundation
Build System: make, msBuild, BitBake, OpenEmbedded

Server Push Thru Http2


Server: nginx-1.15.8 downloaded as Pre-Built Packages from http://nginx.org/en/download.html

Config: in /etc/nginx, different from nginx-1.9.15, whose config in /usr/local/nginx
Add to server section: listen 444 ssl http2;
Add to location section: http2_push /style.css;

Test:
with Chrome: go to https://riowing.net:444/index.htm
Developer Tools – network: header colum shows h2
with Curl 7.63: curl.exe -vso /dev/null –http2 https://riowing.net:444/index.htm
watch for output: “server accepted to use h2”
Notes: style.css is downloaded both with and without http2. The difference is that without a separate corresponding request from browser, or so called Server Push.