Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to specify timelapse bitrate #426

Merged
merged 29 commits into from
Aug 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
94e425e
Add files via upload
EricClaeys Jul 10, 2021
a08f239
Add files via upload
EricClaeys Jul 10, 2021
82f1d28
Add files via upload
EricClaeys Jul 10, 2021
a6d8abf
Add files via upload
EricClaeys Jul 10, 2021
998950d
Merge branch 'thomasjacquin:master' into master
EricClaeys Aug 2, 2021
3ae07e8
Update copy_notification_image.sh
EricClaeys Aug 4, 2021
1145558
Update darkCapture.sh
EricClaeys Aug 4, 2021
2829369
Update darkSubtract.sh
EricClaeys Aug 4, 2021
8b7f315
Update endOfNight.sh
EricClaeys Aug 4, 2021
12042de
Update endOfNight_additionalSteps.sh
EricClaeys Aug 4, 2021
ca5412b
Update generateForDay.sh
EricClaeys Aug 4, 2021
4983636
Update postData.sh
EricClaeys Aug 4, 2021
c8f8ebc
Update saveImageDay.sh
EricClaeys Aug 4, 2021
d19202a
Update saveImageNight.sh
EricClaeys Aug 4, 2021
cecbf31
Update removeBadImages.sh
EricClaeys Aug 4, 2021
6bd2a68
Update timelapse.sh
EricClaeys Aug 4, 2021
1a707fb
Update uploadForDay.sh
EricClaeys Aug 4, 2021
cbba45c
Update README.md
EricClaeys Aug 4, 2021
a273911
Update allsky.sh
EricClaeys Aug 4, 2021
74f6356
Update config.sh.repo
EricClaeys Aug 4, 2021
149cf7b
Update settings_RPiHQ.json.repo
EricClaeys Aug 4, 2021
e321f5e
Update settings_ZWO.json.repo
EricClaeys Aug 4, 2021
fc044bc
Update capture_RPiHQ.cpp
EricClaeys Aug 4, 2021
f67fa12
Update capture.cpp
EricClaeys Aug 5, 2021
d0e862b
Allow user to specify timelapse bitrate
EricClaeys Aug 9, 2021
fc7ed64
Update capture.cpp
EricClaeys Aug 9, 2021
7657eee
Check both Linefeed and Carriage Return
EricClaeys Aug 9, 2021
b302888
Update version; users can change timelapse bitrate
EricClaeys Aug 9, 2021
efd013c
Allow users to specify timelapse bitrate
EricClaeys Aug 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 55 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Allsky Camera ![Release 0.7](https://img.shields.io/badge/Release-0.7-green.svg) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MEBU2KN75G2NG&source=url)
# Allsky Camera ![Release 0.8](https://img.shields.io/badge/Release-0.8-green.svg) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MEBU2KN75G2NG&source=url)



Expand Down Expand Up @@ -58,7 +58,7 @@ There is no 1-click update yet so until then, the easiest is to backup your conf

Here's a quick overview of the configuration files.

the first one is called **settings.json**. It contains the camera parameters such as exposure, gain but also latitude, longitude, etc.
the first one is called **settings.json**. It contains the camera parameters such as exposure, gain but also latitude, longitude, etc. Many settings have both a daytime ("dayXXXX") and nighttime ("nightXXXX") version.

```shell
nano settings.json
Expand All @@ -68,28 +68,34 @@ nano settings.json
| ----------- | ----------- | ----------------|
| width | 0 | 0 means max width. Look up your camera specifications to know what values are supported |
| height | 0 | 0 means max height. Look up your camera specifications to know what values are supported |
| exposure | 10000 | **Night** time exposure in milliseconds. During the day, auto-exposure is used. |
| maxexposure | 20000 | This is the maximum exposure for **night** images when using auto-exposure. During the day, auto-exposure is always used. |
| autoexposure | 1 | Set to 0 to disable auto-exposure at **night**. Auto-exposure delivers properly exposed images throughout the night even if the overall brightness of the sky changes (cloud cover, moon, aurora, etc). When set to 1, *maxexposure* value will be used as the delay between timelapse frames. |
| gain | 50 | Gain for **Night** images. Varies from 0 to 600. During the day, gain is always set to 0 |
| maxgain | 200 | Maximum gain for **night** images when using auto-gain.|
| autogain | 0 | Set to 1 to allow auto-gain at **night**. This mode will adjust the gain of night images when the overall brightness of the sky changes (cloud cover, moon, aurora, etc). **Avoid using autoexposure and autogain together** as it produces unpredicatble results (dark frames, but not always).|
| gamma | 50 | Varies between 0 and 100. This setting increases or decreases contrast between dark and bright areas. |
| brightness | 50 | Varies between 0 and 100. This setting changes the amount of light in the image. |
| dayautoexposure | 1 | Set to 0 to disable auto-exposure during **daytime**. Auto-exposure delivers properly exposed images throughout the day even if the overall brightness of the sky changes (cloud cover, sun, etc). Since daytime exposures are short, there is not daytime "maxexposure". This option is usually only disabled for testing. |
| dayexposure | 1 | **Day** time manual exposure time in milliseconds. Normally daytime auto-exposure will be used; if so, this value is used as a starting exposure. |
| daybrightness | 50 | Varies between 0 and 600. This setting changes the amount of light in **daytime** images. |
| daydelay | 5000 | Time in milliseconds to wait between 2 frames during the day. |
| daybin | 1 | bin 2 collects the light from 2x2 photosites to form 1 pixel on the image. bin 3 uses 3x3 photosites, etc. Increasing the bin results in smaller images and reduces the need for long exposure. Look up your camera specifications to know what values are supported. This variable is usually only changed for testing. |
| nightautoexposure | 1 | Set to 0 to disable auto-exposure at **night**. Auto-exposure delivers properly exposed images throughout the night even if the overall brightness of the sky changes (cloud cover, moon, aurora, etc). When set to 1, *maxexposure* value will be used as the delay between timelapse frames. |
| nightmaxexposure | 20000 | This is the maximum exposure for **night** images when using auto-exposure.
| nightexposure | 10000 | **Night** time exposure in milliseconds. |
| nightautogain | 0 | Set to 1 to allow auto-gain at **night**. This mode will adjust the gain of night images when the overall brightness of the sky changes (cloud cover, moon, aurora, etc). **Avoid using autoexposure and autogain together** as it produces unpredicatble results (dark frames, but not always).|
| nightmaxgain | 200 | Maximum gain for **night** images when using auto-gain.|
| nightgain | 50 | Gain for **Night** images. Varies from 0 to 600. During the day, gain is always set to 0. |
| nightbin | 1 | Similar to "daybin" but for night. |
| nightbrightness | 50 | Varies between 0 and 600. This setting changes the amount of light in **nighttime** images. |
| gamma | 50 | Varies between 0 and 100. This setting increases or decreases contrast between dark and bright areas. This is not supported by all cameras. |
| autowhitebalance | 0 | Sets auto white balance. When used, "wbr" and "wbb" are used as starting points. |
| wbr | 53 | Varies between 0 and 100. This is the intensity of the red component of the image. |
| wbb | 90 | Varies between 0 and 100. This is the intensity of the blue component of the image. |
| bin | 1 | bin 2 collects the light from 2x2 photosites to form 1 pixel on the image. bin 3 uses 3x3 photosites, etc. Increasing the bin results in smaller images and reduces the need for long exposure. Look up your camera specifications to know what values are supported |
| delay | 10 | Time in milliseconds to wait between 2 frames at night. |
| daytimeDelay | 5000 | Time in milliseconds to wait between 2 frames during the day. |
| type | 1 | Image format. 0=RAW 8 bits, 1=RGB 24 bits, 2=RAW 16 bits |
| quality | 95 | Compression of the image. 0(low quality) to 100(high quality) for JPG images, 0 to 9 for PNG |
| autousb | 0 | Set to 1 to enable auto USB bandwidth. This option is primarily for testing. |
| usb | 40 | This is the USB bandwidth. Varies from 40 to 100. |
| filename | image.jpg | this is the name used across the app. Supported extensions are JPG and PNG. |
| flip | 0 | 0=Original, 1=Horizontal, 2=Vertical, 3=Both |
| text | text | Text overlay. **Note**: It is replaced by timestamp if time=1 |
| extratext | | (ZWO ONLY) The FULL path to a text file which will be displayed under the Exposure/Gain. The file can contain multiple lines which will be displayed underneath each other |
| extratextage | 600 | (ZWO ONLY) If using the extra text file then it must be updated within this number of seconds, if not it will not be displayed. Set to 0 to ignore this check and always didplay it |
| textlineheight | 30 | (ZWO ONLY) The line height of the text displayed in the image, if you chnage the font size the adjust this value if required |
| textlineheight | 30 | (ZWO ONLY) The line height of the text displayed in the image, if you chnage the font size then adjust this value if required |
| textx | 15 | Horizontal text placement from the left |
| texty | 35 | Vertical text placement from the top |
| fontname | 0 | Font type for the overlay. 0=Simplex, 1=Plain, 2=Duplex, 3=Complex, 4=Triplex, 5=Complex small, 6=Script simplex, 7=Script complex |
Expand All @@ -98,12 +104,15 @@ nano settings.json
| fontsize | 7 | Font size |
| fonttype | 0 | Controls the smoothness of the fonts. 0=Antialiased, 1=8 Connected, 2=4 Connected. |
| fontline | 1 | font line thickness |
| outlinefont | 0 | Set to 1 to add an outline to the text overlay to improve contrast. |
| latitude | 60.7N | Latitude of the camera. N for North and S for South
| longitude | 135.05W | longitude of the camera. E for East and W for West |
| angle | -6 | Altitude of the sun above or below the horizon at which capture should start/stop. Can be negative (sun below horizon) or positive (sun above horizon). 0=Sunset, -6=Civil twilight, -12=Nautical twilight, -18=Astronomical twilight.
| time | 1 | Replaces the text overlay |
| darkframe | 0 | Set to 1 to enable dark frame capture. In this mode, overlays are hidden and the image is saved as dark.png by default |
| showDetails | 1 | Displays the exposure, gain and temperature in the overlay |
| time | 1 | Replaces the text overlay with the time the picture was taken. |
| timeformat | %Y%m%d %H:%M:%S | Determines the format of the displayed time. See strftime(3). Use _ (underscore) for spaces. |
| darkframe | 0 | Set to 1 to enable dark frame capture. In this mode, overlays are hidden. |
| showDetails | 1 | Displays the exposure, gain and temperature in the overlay (OBSOLETE) |
| notificationimages | 1 | Set to 0 to disable notification images, e.g., "Camera off during day" if daytime images are not being taken. |

The second file called **config.sh** lets you configure the overall behavior of the camera. Options include functionalities such as upload, timelapse, dark frame location, keogram.

Expand All @@ -120,6 +129,7 @@ nano config.sh
| TIMELAPSE | true | Build a timelapse at the end of the night |
| TIMELAPSEWIDTH | 0 | Overwrite the width of the generated timelapse, must be divisible by 2
| TIMELAPSEHEIGHT | 0 | Overwrite the height of the generated timelapse, must be divisible by 2
| TIMELAPSE_BITRATE | 2000k | Bitrate of the timelapse video. Higher numbers produce better quality but bigger files. Don't forget to include the trailing "k".
| FPS | 25 | The timelapse frame rate (frames per second)
| KEOGRAM | true | Builds a keogram at the end of the night |
| UPLOAD_KEOGRAM | false | Set to true to upload the keogram to your server |
Expand All @@ -142,7 +152,20 @@ nano config.sh
| AUTO_STRETCH | false | If enabled the captured image will be stretched |
| AUTO_STRETCH_AMOUNT | 10 | Indicates how much to increase the contrast. For example, 0 is none, 3 is typical and 20 is a lot |
| AUTO_STRETCH_MID_POINT | 10% | Indicates where the maximum change 'slope' in contrast should fall in the resultant image (0 is white; 50% is middle-gray; 100% is black). |
| CAMERA_SETTINGS | /home/pi/allsky/settings.json | Path to the camera settings file. **Note**: If using the GUI, this path will change to /etc/raspap/settings.json |
| RESIZE_UPLOADS | false | Set to true to resize uploaded pictures |
| RESIZE_UPLOADS_SIZE | 962x720 | Sets the width x height of resized images being uploaded |
| THUMBNAIL_SIZE_X | 100 | Sets the width of thumbnails |
| THUMBNAIL_SIZE_Y | 75 | Sets the height of thumbnails |
| REMOVE_BAD_IMAGES | false | Scan for, and remove corrupt or too bright/too dark images before generating keograms and startrails |
| REMOVE_BAD_IMAGES_THRESHOLD_LOW | 1 | Images whose mean brightness is below this percent will be removed |
| REMOVE_BAD_IMAGES_THRESHOLD_HIGH | 90 | Images whose mean brightness is above this percent will be removed (max: 100) |
| UHUBCTL_PATH | n/a | If you have the "uhubctl" command installed (it resets the USB bus), enter its path name |
| UHUBCTL_PORT | n/a | Enter the USB port the camera is on. Port 1 is USB 2.0 and port 2 is USB 3.0 |
| IMG_DIR | allsky | Location of the image the website will use. "allsky" is /var/www/html/allsky. Set to "current" to use /home/pi/allsky. |
| IMG_PREFIX | liveview- | An optional prefix on the website image file name, before "image.jpg" (or whatever your image is called) |
| TEMPERATURE | C | How to display the temperature in image overlays as well as on the "System" page of the web GUI. |
| CAMERA_SETTINGS_DIR | /etc/raspap | Path to the camera settings file |
| CAMERA_SETTINGS | /home/pi/allsky/settings.json | Name of the camera settings file. **Note**: If using the GUI, this path will change to /etc/raspap/settings.json |

When using the cropping options the image is cropped from the center so you will need to experiment with the correct width and height values. Normally there will be no need to amend the offset values.

Expand Down Expand Up @@ -273,7 +296,7 @@ GUI method:
* Open the Camera Settings tab and set Dark Frame to Yes.
* Hit the Save button
* Dark frames are created in a `darks` directory. A new dark is created every time the sensor temperature changes by 1 degree C.
* On the Camera Settings tab and set Dark Frame to No.
* On the Camera Settings tab set Dark Frame to No.
* Hit the Save button
* Remove the cover from the lens/dome
* Open the scripts editor tab, load `config.sh` and set `DARK_FRAME_SUBTRACTION` to true
Expand Down Expand Up @@ -350,7 +373,7 @@ The startrails program is used by the `endOfNight.sh` script.
The program takes 4 arguments:
- Source directory
- File extension
- Brightness treshold to avoid over-exposure: 0 (black) to 1 (white).
- Brightness threshold to avoid over-exposure: 0 (black) to 1 (white).
- Output file

Example when running the program manually:
Expand Down Expand Up @@ -393,7 +416,7 @@ This will compile the new code and create a new binary.

If you have set the upload options to true in `config.sh`, that means you probably already have a website. If you want to display a live view of your sky on your website like in this [example](http://www.thomasjacquin.com/allsky), you can donwload the source files from this repository: [https://github.com/thomasjacquin/allsky-website.git](https://github.com/thomasjacquin/allsky-website.git).

If you want to host the website on the raspberry Pi, run the following command. Note that this website is installed on the same webserver as the GUI. Currently, reinstalling the GUI will wipe you website.
If you want to host the website on the raspberry Pi, run the following command. Note that this website is installed on the same webserver as the GUI. Currently, reinstalling the GUI will wipe your website.

```
website/install.sh
Expand Down Expand Up @@ -436,6 +459,18 @@ If you've built an allsky camera, please send me a message and I'll add you to t
* Configuration variables to crop black area around image
* Timelapse frame rate setting
* Changed font size default value
* version **0.8**: Workaround for ZWO daytime autoexposure bug.
* Improved exposure transitions between day and night so there's not a huge change in brightness.
* Decrease in ZWO sensor temperature.
* Lots of new settings, including splitting some settings into day and night versions.
* Error checking and associated log messages added in many places.
* Ability to have "notification" images displayed, such as "Allsky is starting up" and "Taking dark frames".
* Ability to set size uploaded images are resized to.
* Ability to set thumbnail size.
* Ability to delete bad images (corrupt and too light/dark).
* Ability to set an image file name prefix.
* Ability to reset USB bus if ZWO camera isn't found (requires "uhubctl" command to be installed).
* Ability to specify format of time displayed on image and temperature displayed in Celcius, Fahrenheit, or both.

## Donation

Expand Down
Loading