My telecine software - New version

Participating in this forum is undoubtedly an enriching experience.
I have had access to knowledge on aspects previously unknown to me.

@dgalland has suggested to me to use the pigpio library on the server. The use of this library supposes a more regular and stable control of the motor and a higher speed.

@dgalland also pointed out to me the possibility of using a function that calculates a numerical index of focus quality. In the preview images now appears such an index that gives us objective data on the focus of the captured images.

@cpixip has suggested a function for the normalization of the HDR images obtained using the Mertens algorithm, which produces final images with better contrast.

I have incorporated these contributions with notable success into this new version of the software. Thank you both for your contributions.

For my part, I had observed that during long scanning sessions, exceptions of the type PiCameraRuntimeError (ā€˜Timed out waiting for capture to endā€™) were thrown.

These exceptions meant the interruption of the work and the restart of the software.

I have not been able to determine the exact cause of the problem, so I have decided to catch the exceptions in the server software, so that it recovers automatically and continues with the work as if nothing had happened.

I have to tell potential interested parties to read the new instructions carefully. Especially the setup of the server has changed a lot.

Greetings to all members of the forum.

Instructions.pdf (45.4 KB)
DSuper8-Client.zip (791.0 KB)
DSuper8-Server.zip (15.2 KB)
DSuper8-conf-pigpiod.zip (999 Bytes)
DSuper8 Wiring Diagram.pdf (45.5 KB)

9 Likes

@Manuel_Angel I havenā€™t used your software yet, but would like to thank you for sharing the information. Hope that when the time comes, it would help me as reference for Mertens and for the RPi Camera. Great work, and I appreciate you sharing it in the forum.

1 Like

@Manuel_Angel thanks a lot for sharing your development. Appreciate. Iā€™ve installed the new softwareā€¦ success. Just a warning to whom want to do a fresh install. The latest Raspi OS proposed is based on Debian11 , called ā€œBullseyeā€ ,many libraries are not updated yet.Better stay with the previous OS ā€œBusterā€.

4 Likes

@PM490, thanks for your kind words. Of course you can count on everything that is within my reach to carry out your project.

Thanks @sciallino, I do not know much about the matter, but from what I understand, with the new version of Raspberry Pi OS there have been important changes in the software related to the camera and the old PiCamera library does not work, so that, at the moment, the ones we use PiCamera must remain in the Buster version of the operating system.

2 Likes

Howdy, thank you for the update!

Am having a problem with running the daemon. It is in the correct location /lib/systemd/system.

pi@raspberrypi:/ $ systemctl start pigpiod
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to start ā€˜pigpiod.serviceā€™.
Multiple identities can be used for authentication:

  1. , (pi)
  2. root
    Choose identity to authenticate as (1-2): 2
    Password:
    polkit-agent-helper-1: pam_authenticate failed: Authentication failure
    ==== AUTHENTICATION FAILED ===
    Failed to start pigpiod.service: Access denied
    See system logs and ā€˜systemctl status pigpiod.serviceā€™ for details.

Upon reviewing the pigpiod log details I get the following

Dec 03 16:18:53 raspberrypi systemd[1]: Starting Daemon required to control GPIO
Dec 03 16:18:53 raspberrypi pigpiod[2727]: 2021-12-03 16:18:53 initInitialise: C
Dec 03 16:18:53 raspberrypi pigpiod[2727]: Canā€™t initialise pigpio library
Dec 03 16:18:53 raspberrypi systemd[1]: Started Daemon required to control GPIO
Dec 03 16:18:53 raspberrypi systemd[1]: pigpiod.service: Main process exited, co
Dec 03 16:18:53 raspberrypi systemd[1]: pigpiod.service: Failed with result 'exi

ALSO, I just happend to select (when prompted) identity 1 instead of 2 (root) and did get further along. I had gotten to the third Daemon status command and then received this error

pi@raspberrypi:/ $ systemctl status pigpiod
ā— pigpiod.service - Daemon required to control GPIO pins via pigpio
Loaded: loaded (/lib/systemd/system/pigpiod.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2021-12-03 16:42:01 EST; 1min 52s ago
Process: 2965 ExecStart=/usr/bin/pigpiod -l -n 127.0.0.1 -p 8889 (code=exited, status=0/SUCCESS)
Main PID: 2966 (code=exited, status=1/FAILURE)

Dec 03 16:42:01 raspberrypi systemd[1]: Starting Daemon required to control GPIO pins via pigpioā€¦
Dec 03 16:42:01 raspberrypi pigpiod[2965]: 2021-12-03 16:42:01 initInitialise: Canā€™t lock /var/run/pigpio.pid
Dec 03 16:42:01 raspberrypi pigpiod[2965]: Canā€™t initialise pigpio library
Dec 03 16:42:01 raspberrypi systemd[1]: Started Daemon required to control GPIO pins via pigpio.
Dec 03 16:42:01 raspberrypi systemd[1]: pigpiod.service: Main process exited, code=exited, status=1/FAILURE
Dec 03 16:42:01 raspberrypi systemd[1]: pigpiod.service: Failed with result ā€˜exit-codeā€™.

Any advice would be much appreciated!

Hi @Wheaticus,

To start and stop the daemon, give the commands in root mode:

Daemon start:
sudo systemctl start pigipiod

It is advisable to enable autostart at each server startup:
sudo systemctl enable pigipiod

Regards.

Okay, I think Iā€™m a bit clueless and in over my head. When you say give commands in root mode that has nothing to do with being in the root directory, right? Adding SUDO to the beginning of a command is what you mean by giving commands in root mode, am I correct in assuming this? I tried to look all this up on Google but didnā€™t see anything that clarified any better.

Anyways, I did the command as you mentioned above. And the following occurred:

pi@raspberrypi:~/Public/DS8server $ sudo systemctl enable pigpiod
pi@raspberrypi:~/Public/DS8server $ python3 DS8Server.py
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Canā€™t connect to pigpio at localhost(8889)

Did you start the pigpio daemon? E.g. sudo pigpiod

Did you specify the correct Pi host/port in the environment
variables PIGPIO_ADDR/PIGPIO_PORT?
E.g. export PIGPIO_ADDR=soft, export PIGPIO_PORT=8888

Did you specify the correct Pi host/port in the
pigpio.pi() function? E.g. pigpio.pi(ā€˜softā€™, 8888)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Traceback (most recent call last):
File ā€œDS8Server.pyā€, line 39, in
from controlProcess import DS8Control, MotorDriver
File ā€œ/home/pi/Public/DS8server/controlProcess.pyā€, line 52, in
pi.set_mode(light_pin, pigpio.OUTPUT)
File ā€œ/usr/lib/python3/dist-packages/pigpio.pyā€, line 1344, in set_mode
return _u2i(_pigpio_command(self.sl, _PI_CMD_MODES, gpio, mode))
File ā€œ/usr/lib/python3/dist-packages/pigpio.pyā€, line 993, in _pigpio_command
sl.s.send(struct.pack(ā€˜IIIIā€™, cmd, p1, p2, 0))
AttributeError: ā€˜NoneTypeā€™ object has no attribute ā€˜sendā€™

One other thing, I actually had to use SUDO with a move command just to get the pigpiod.service in the appropriate directory otherwise I would get a permission failure. Anyways, Iā€™ve noticed that all the other services in the lib/systemd/system folder have an owner/group of root/root, however the pigpiod.service that I moved into this folder is pi/pi. Does any of this matter?

@Wheaticus,

I am sorry I did not express myself clearly.

On Linux machines ā€œrootā€ is usually the generic name of the system administrator.

When I say run commands in root mode, I am referring to running commands with administrator privileges.

One way to do this is with the sudo command, which once configured allows the user who uses it to escalate administrator privileges.

When you have run the sudo systemctl enable pigipiod command, you have actually enabled automatic startup at system boot, but at that moment the daemon is not running and for this reason it has given the error.

To start the daemon immediately: sudo systemctl start pigipiod

To check the status of the daemon (you donā€™t have to do it as an administrator): systemctl status pigipiod

In order not to overload the thread, from now on we can communicate by private messages.

Regards

1 Like

I have recently finished development of a new version (20221130) of DSuper8 scanning software.
In my opinion, the functionality and GUI were already quite complete and optimized, so they have not been changed.

Where very notable changes have been introduced is in the internal functioning of the program.
The client program has been ported to PyQt6 and Python 3.10 and the GUI functionality has been improved.

On the server the dependency on PyQt5 has been removed and the most important functions have been simplified and improved.

I leave the links for download:

English version:
https://drive.google.com/drive/folders/1Fgs7hXBRYLF43cmaUQ8_ns3yllgt8-MZ?usp=share_link

VersiĆ³n espaƱola:
https://drive.google.com/drive/folders/1N-auiukgV0bPwO_R2kPsrRp4icc6-WKZ?usp=share_link

5 Likes

hi,

getting again into the scanning thing now using a raspi hq cam after using a flatbet photo scanner a few years ago with my own code, Iā€™d just like to thank you for your work and leave two ideas:

  • maybe use the pigar package to generate a requirements.txt for your project which will contain the dependencies (packages and their versions) so users can just do a pip install -r requirements.txt and get the deps installed.
  • maybe push your code to GitHub, so contributions would be easier and documentation can also live in the repository there with a README file having a short description of the project

greets
simon

Hi @d_fens,

Thanks for your interest.

Although I try to produce quality software, Iā€™m not really a professional programmer.

Several years ago I started developing the DSuper8 software for my personal use.
Later, when I joined the forum, I thought that the software could be useful for other users and for this reason I decided to publish it.
I have published it in several ways, but I have never used github.

On the other hand, I am aware that some users find installing dependencies problematic.

I am going to study your suggestions, which, if applied well, will surely facilitate the distribution and use of the software.

Regards

1 Like

Hi there. I was looking at the latest build and got it running with a Pi4 and a Windows PC (havenā€™t built my machine yet tho), its very cool!

I have a few questions thoughā€¦

  • Is there a way to have it run standalone on a raspberry pi? I have the v4 8GB version and tried to run it locally but I cant install PyQt6 on it as I donā€™t think its compatible with the Pi, it installs fine on Windows though.
  • On the subject of standalone, Iā€™m looking to run Raspian OS and save the captures on an SSD so will the Pi 4 be fast enough to process the files that way?
  • Is it possible to save as raw files like DNG rather than jpg? Would keep the dynamic range of the image.
  • I was going to add an RGBW LED to my build, or should I just use the DSuper to adjust colours of the camera input? Maybe as an option add RGB lights control in the DSuper client?

Sorry its a lot! I might have others to ask but those were my main ones.

Good work!

Hi @bassquake,

First of all thank you for your kind words.

This thread corresponds to version 20221130 of the DSuper8 software.

Iā€™ve released a more recent version 20230430, which features several important improvements, mainly the use of the new picamera2 library, instead of the deprecated picamera.

I donā€™t know the version you have installed on your system.
I am going to answer your questions.

This issue is already discussed in the forum.

In response to a suggestion by @Moevi.nl I have done tests using RPi4 running both the client and server software on the same machine.

The results of the tests confirm that it is a viable option.

The bottleneck is the HDR blending algorithm. While on a PC it runs in a fraction of a second, on the RPi4 it takes several seconds. The capture speed slows down, but it is a perfectly usable option, especially if we take into account other advantages of the RPi4 compared to a PC, for example the consumption that in the case of the RPi4 is really derisory.

On the other hand, the Raspberry Pi OS, still in its latest version Bullseye, is based on the Debian distribution of Linux.

This is an excellent distribution, although it has always been characterized as quite conservative, in the sense that it uses software packages that are highly tested and stable, and therefore somewhat old.
DSuper8 is based on PyQt6 and Python 3.10, which are currently not in the Raspberry Pi OS repositories.

In my case, to carry out the aforementioned tests, I had to compile both PyQt6 and Python 3.10.
The build process takes several hours and is somewhat problematic if we do not have the necessary dependencies installed on the RPi4.

If we manage to successfully finish the compilation, the DSuper8 software runs normally without problems.

Definitely. It is highly recommended to use a hard disk with USB3 interface instead of using the RPiā€™s microSD memory. These flash memories tend to degrade fairly quickly with frequent write and erase operations.

In my case I have a conventional portable hard drive (not SSD) of 2 TB with USB3 interface, powered by the same USB3 interface. I have had it running for several years with very good results. On the drive is both the Bullseye software and my own data files. The improvement is very noticeable in terms of speed, security and reliability.

Just these days Iā€™m doing tests capturing dng files.

It certainly is an option. The picamera2 library can directly generate dng files.
What I have observed so far is the following:

With the DSuper8 software, properly configured, good results are obtained in my opinion. Each frame is digitized into a jpg file of about 500 KB, which requires virtually no retouching. The software itself adjusts the white balance, brightness, contrast, saturation, HDR blending, image rotation, trimming unwanted edgesā€¦

With dng files, we get an 18MB file for each frame of the movie.
These files must be processed one by one with a suitable software, (in my case I am using RawTherapee).

At the moment I am in a very early phase of the tests.
Iā€™m thinking of posting my results on the forum.

If I see that it is worth it, I will try to develop a new version of the software that includes the possibility of capturing dng files.

In my case I have always used white light LED lamps. I have never considered the option of using colored LEDs.

In my opinion, with a good quality white LED lamp and a color temperature similar to the halogen lamps in older projectors, good results can be achieved without complicating our lives.

With the DSuper8 software, the blue and red gains can be fine-tuned to obtain a good white balance.

Best regards

This thread corresponds to version 20221130 of the DSuper8 software.

Iā€™ve released a more recent version 20230430

Oops, I didnā€™t realise I posted on an older build version of the forum. Yes, the 20230430 version is the one I used.

Regarding the dng images, I think you can import them into Davinchi Resolve (free editing software) as an image sequence which you can then tweak just like a normal video file with all the raw editing benefits!

Thanks for responding on the other questions.