User Tools

Site Tools


doc:appunti:hardware:sjcam-8pro

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
doc:appunti:hardware:sjcam-8pro [2022/04/26 12:35] – [Dual operating system: GNU/Linux and RTOS] niccolodoc:appunti:hardware:sjcam-8pro [2022/06/14 10:59] – [Color profiles] niccolo
Line 1: Line 1:
-====== SJCAM SJ8 Pro ====== +====== SJCAM SJ8 Pro Review ======
- +
-See also my other page about **[[ambarella_custom_firmware]]**.+
  
 The **SJCAM SJ8 Pro** action camera was introduced in **2018**, it features **4k video** at **60 fps** and **gyroscope image stabilization**. I purchaesd it in 2021 to work alongside my old [[xiaomi_yi|Xiaomi Yi]], mainly because I was interested in image stabilization. The **SJCAM SJ8 Pro** action camera was introduced in **2018**, it features **4k video** at **60 fps** and **gyroscope image stabilization**. I purchaesd it in 2021 to work alongside my old [[xiaomi_yi|Xiaomi Yi]], mainly because I was interested in image stabilization.
 +
 +{{.:sjcam:sjcam-sj8pro-backpack-mount.jpg?direct&600|The SJCAM SJ8 Pro mounted on the shoulder strap of a backpack}}
  
 Unfortunately SJCAM does not support this camera very much: the latest **firmware upgrade** is from September 2020, despite there are some evident bugs and several aspects of the user interface which should be improved. Thirdy part support is poor: there is no **waterproof case** except the original one, which unfortunately has a plastic window. There is not much documentation about **customizing the firmware** or scripting using the **Ambarella Scripting**. Unfortunately SJCAM does not support this camera very much: the latest **firmware upgrade** is from September 2020, despite there are some evident bugs and several aspects of the user interface which should be improved. Thirdy part support is poor: there is no **waterproof case** except the original one, which unfortunately has a plastic window. There is not much documentation about **customizing the firmware** or scripting using the **Ambarella Scripting**.
 +
 +See also my other page about this camera: **[[sjcam-8pro-ambarella-firmware-modding]]**, **[[sjcam-8pro-ambarella-wifi-api]]** and **[[sjcam-8pro-custom-firmware]]**.
 +
 +===== Specs, Pros and Cons =====
  
 **Pros** **Pros**
Line 123: Line 127:
 {{.:sjcam:color-profile-flat.jpg?direct&400|Color Profile Flat}} {{.:sjcam:color-profile-flat.jpg?direct&400|Color Profile Flat}}
  
-You can edit the color profiles using the BitrateEditor software. But be careful that the profile selected at bootstrap is neither //SJCAM - Vivid// nor //Flat//, but another one stored in some other part of the firmware that I was unable to locate.+You can edit the color profiles using the BitrateEditor software. Be careful that the profile selected at bootstrap is neither //SJCAM - Vivid// nor //Flat//, but the one named //Default// by BitrateEditor (starting from version 10.7 - Nov 3, 2021).
  
 ==== Flat vs SJCAM - Vivid ==== ==== Flat vs SJCAM - Vivid ====
Line 197: Line 201:
 {{.:sjcam:sj8pro-main-screen.png?640|SJCAM SJ8 Pro Main Screen}} {{.:sjcam:sj8pro-main-screen.png?640|SJCAM SJ8 Pro Main Screen}}
  
-===== Using the cam without the touchscreen =====+===== The remote control ===== 
 + 
 +I think that **SJCAM missed a great opportunity** to make this camera a perfect choice by designing a **remote control which is almost useless**. The remote control can be mounted on a wrist strap or used like a nice button tag, the five buttons are: 
 + 
 +  * WiFi 
 +  * Power OFF 
 +  * Video start/stop 
 +  * Single photo shutter 
 +  * Photo burst shutter 
 + 
 +The **two deadly sins** committed by designers are: 
 + 
 +  * **No feedback** if you actually pressed for **START** recording or **STOP** recording! If you don't have the camera screen in sight (e.g. you have mounted it on the helmet or pointing backward on your bike) you will never know if you are filming or not! Unfortunately the camera does not have any sound feedback either. 
 +  * If you accidentally press the **Power OFF button** you cannot turn ON the camera again. A big problem if you mounted the camera in a position where you cannot reach it with your finger! 
 + 
 +===== Using the camera without the touchscreen =====
  
 When the camera is into the **waterproof case** you can operate it only with the buttons, the touch screen does not work. My camera was shipped with a spare case back, which is thin enough to let operate the touchscreen; mind that mounting that back cover you loose the 30 meters waterproof feature, the case becomes only splash resistant. When the camera is into the **waterproof case** you can operate it only with the buttons, the touch screen does not work. My camera was shipped with a spare case back, which is thin enough to let operate the touchscreen; mind that mounting that back cover you loose the 30 meters waterproof feature, the case becomes only splash resistant.
Line 246: Line 265:
  
 There are many hackers who produce modified versions of the original firmware. In general they distribute the original firmware patched in several places, mainly to customize framerates, exposure parameters, etc. There are many hackers who produce modified versions of the original firmware. In general they distribute the original firmware patched in several places, mainly to customize framerates, exposure parameters, etc.
 +
 +I created a custom firmware to improve some video codec settings and to improve image quality (mainly color balance and saturation). You can find it here: **[[sjcam-8pro-custom-firmware]]**.
  
 Generally there is **no access to the source code**, so **patching the firmware binary** is a rather delicate task, requiring to know the exact offset of the data into that **specific version of the firmware**, the structure and the lenght of the data and eventually how to **update the embedded checksums**. SJCAM does not facilitate the task, because it distribute different versions of the firmares marked with the same version number. Generally there is **no access to the source code**, so **patching the firmware binary** is a rather delicate task, requiring to know the exact offset of the data into that **specific version of the firmware**, the structure and the lenght of the data and eventually how to **update the embedded checksums**. SJCAM does not facilitate the task, because it distribute different versions of the firmares marked with the same version number.
Line 251: Line 272:
 The best approach is to use the **[[https://github.com/vmax1145/BitrateEditor|BitrateEditor]]**, a graphical Java program which facilitates the task of editing various parameters in form of **easy readable tables**. The program contains several configuration files, so it can check that you are actually editing the proper version of the firmware (it can do check of particular strings at particular offset, calculate regions checksums, etc.). The program has the capability to re-pack the firmware image after the edits, **updating the checksums** so that the file will be **flashable** into the camera. The best approach is to use the **[[https://github.com/vmax1145/BitrateEditor|BitrateEditor]]**, a graphical Java program which facilitates the task of editing various parameters in form of **easy readable tables**. The program contains several configuration files, so it can check that you are actually editing the proper version of the firmware (it can do check of particular strings at particular offset, calculate regions checksums, etc.). The program has the capability to re-pack the firmware image after the edits, **updating the checksums** so that the file will be **flashable** into the camera.
  
-You can refer to the page **[[ambarella_custom_firmware]]** with my notes about customizing the SJ8 Pro firmware using BitrateEditor. You can also refer to the program I wrote which can extract files and partitions from the firmware files: **[[https://github.com/RigacciOrg/ambarella-h22-firmware-tools|ambarella-h22-firmware-tools]]**.+You can refer to the page **[[sjcam-8pro-ambarella-firmware-modding]]** with my notes about customizing the SJ8 Pro firmware using BitrateEditor. You can also refer to the program I wrote which can extract files and partitions from the firmware files: **[[https://github.com/RigacciOrg/ambarella-h22-firmware-tools|ambarella-h22-firmware-tools]]**.
  
 ===== SD Card partitioning and formatting with GNU/Linux ===== ===== SD Card partitioning and formatting with GNU/Linux =====
Line 622: Line 643:
  
  
-===== TCP API =====+===== The TCP API =====
  
-The camera offers an **API** over the **TCP protocol** on port **7878**. When the WiFi is on, you can open a telnet connection with it and exchange JSON messages to control the camera. This is the interface used by the official app.+See the page **[[sjcam-8pro-ambarella-wifi-api]]** about the programming interface (API) offered by the SJCAM SJ8 Pro over the WiFi connection or even in localhost. The interface is offered on port **TCP/7878**.
  
-The protocol was at least partially **reversed engineered** (see the [[#web_references|web references]] below)I was able to **create script** to select the Color Profile automatically at boot. Remember that, due a firmware bug, the color profile choiche is not preserved across reboots, and you have to disable the Gyro Stabilizer before selecting the Color Profile.+The interface is based on **JSON messages**: you can exchange them over the WiFi connection as the official app **[[https://play.google.com/store/apps/details?id=org.jght.sjcam.zone|SJCAM Zone]]** does between the Android device and the cameraYou can also **connect PC** to the camera via WiFi and use any programming language supporting TCP sockets.
  
-Executing that script at camera startup is a rather convoluted process: +You can also send messages from the camera itself: the **RTOS** operating system provides the **telnet** command which can ben used to talk to the **GNU/Linux** operating system running on the same camerawhich handles the API requests (the camera actually runs two operating system simultaneuslyRTOS and Linux)In this scenario was able to talk to the API but with no interactionI used ''telnet'' to only send messages but I did not find any way to read the answers.
- +
-  * At bootstrap, the RTOS executes the **autoexec.ash** Ambarella Script. +
-  * Using the command **t ipc rpc clnt exec2** it is possible to execute a script into the **GNU/Linux** operating system+
-  * The GNU/Linux environment has the **busybox** softwareso it is possible to use the **telnet** command to establish a TCP connection with the API server at **localhost:7878**. +
-  * The required **JSON commands** are sent to the API server to disable Gyro Stabilizer, select the Color Profile and then re enable Gyro Stabilizer. +
- +
-**WARNING**: It seems that the API implementation is rather buggy. I experienced several problems ranging from **commands not aknowledged** if sent with bad timing (not waiting enough time from one command to the next), even to suddenly **reboot**! +
- +
-Here there are the three files that must be created on the root directory of the SD card: +
- +
-**autoexec.ash** +
- +
-<code> +
-sleep 5000 +
-t ipc rpc clnt exec2 '/tmp/SD0/autoexec.rc' +
-</code> +
- +
-**autoexec.rc** +
- +
-<code> +
-#!/bin/sh +
-/tmp/SD0/api-set-options +
-</code> +
- +
-**api-set-options** +
- +
-<code> +
-#!/bin/sh +
-+
-# Send some commands to the TCP:7878 API+
-# Set the color profile to "SJCAM - Vivid" and enable Gyro Stabilizer. +
- +
-# We should get the token number from msg_id 257, but this script +
-# is executed at boot, so the token should be always "1"+
-T=1 +
- +
-# A pause of 0.5 is required for each command to be completed. +
-# By trial we discovered that a pause of 0.4 is not sufficient. +
-S=0.52 +
- +
-+
-  echo '{"msg_id"257, "token": 0}'; sleep 1.0; +
-  echo '{"msg_id": 260, "token": '$T'}'; sleep $S; +
-  echo '{"msg_id": 2, "type": "Gyro Stabilizer", "param": "Off",           "token": '$T'}'; sleep $S; +
-  echo '{"msg_id": 2, "type": "Color Profile",   "param": "Flat",          "token": '$T'}'; sleep $S; +
-  echo '{"msg_id": 2, "type": "Color Profile",   "param": "SJCAM - Vivid", "token": '$T'}'; sleep $S; +
-  echo '{"msg_id": 2, "type": "Gyro Stabilizer", "param": "On",            "token": '$T'}'; sleep $S; +
-  echo '{"msg_id": 259, "token": '$T'}'; sleep $S; +
-  #echo '{"msg_id": 3,   "token": '$T'}'; sleep $S; +
-  sleep 1.0; +
-} | telnet localhost 7878 +
-echo +
-</code>+
  
 ===== Tips ===== ===== Tips =====
Line 710: Line 678:
     * **[[https://www.goprawn.com/forum/ambarella-cams/1942-script-ideas-for-a12-cams|Script ideas for A12 cams]]**     * **[[https://www.goprawn.com/forum/ambarella-cams/1942-script-ideas-for-a12-cams|Script ideas for A12 cams]]**
     * **[[https://github.com/Theliel/Xiaomi-Mijia-4K/blob/master/resources/AmbaShell.txt|Xiaomi-Mijia-4K AmbaShell.txt]]**     * **[[https://github.com/Theliel/Xiaomi-Mijia-4K/blob/master/resources/AmbaShell.txt|Xiaomi-Mijia-4K AmbaShell.txt]]**
-  * **HTTP API** 
-    * **[[https://www.goprawn.com/forum/ambarella-cams/4867-http-api-thieye-t5e|HTTP API (Thieye T5e)]]** 
-    * **[[https://github.com/vogloblinsky/elmo-qbic-4-cam-rig-manager/blob/master/API_Reverse_engineering.md|API Reverse engineering]]** 
   * **[[https://sjcam.com/community/threads/1080-ultra-vs-1080-and-4k-ultra-vs-4k.2939/|1080 Ultra vs 1080 and 4K Ultra vs 4K]]**   * **[[https://sjcam.com/community/threads/1080-ultra-vs-1080-and-4k-ultra-vs-4k.2939/|1080 Ultra vs 1080 and 4K Ultra vs 4K]]**
   * **{{.:sjcam:sjcam-sj8-pro-manual.pdf|SJCAM SJ8 Pro Manual}}**   * **{{.:sjcam:sjcam-sj8-pro-manual.pdf|SJCAM SJ8 Pro Manual}}**
   * **{{https://www.youtube.com/watch?v=vBQ434rOlL8|SJCAM SJ8 Pro discontinued in favor of Vantop Moment 6S}}**   * **{{https://www.youtube.com/watch?v=vBQ434rOlL8|SJCAM SJ8 Pro discontinued in favor of Vantop Moment 6S}}**
  
doc/appunti/hardware/sjcam-8pro.txt · Last modified: 2023/06/09 12:21 by niccolo