Yet Another Raspberry Pi Telecine

1,609 views
Skip to first unread message

Dominique Galland

unread,
Jan 20, 2019, 9:35:57 AM1/20/19
to Raspberry Pi Film Capture
I announce the creation of a new Raspberry-based Telecine project. This is not a fork of Joe Herman's project because all the software part has been rewritten.
However the concept, the hardware part owe a lot to Joe's project that I thank for his inspiration. I hope to bring some new ideas.
For the moment the project only includes the documentation as proof of concept and implementation ideas.
The project is working properly for me and the code should soon follow,


Regards

Dominique Galland

unread,
Jan 29, 2019, 6:01:26 AM1/29/19
to Raspberry Pi Film Capture
I released the current state of the code. The application works perfectly for me and I captured several hours of movies.
Obviously the code requires a little polishing and reliability. Thank you for your indulgence, remarks or questions.
Dominique Galland

Terry D

unread,
Sep 14, 2019, 4:05:10 PM9/14/19
to Raspberry Pi Film Capture
Thank you for creating this project! Are there benefits of using your software instead of Joe Herman's? Also do you have any sample videos?

Dominique Galland

unread,
Sep 15, 2019, 2:10:14 PM9/15/19
to Raspberry Pi Film Capture
The hardware, camera, engine, ... is the same as in Joe's project, so you can easily try both!
I think that in my project there is a better control of the motor and its parameters (pins and levels, progressive acceleration at startup to avoid blocking) 
There are also experiments on merge, calibration of the camera and comparaison of V1 and V2 cameras 
I also think that the general structure of the code is clearer if you want to understand it and make some changes.

A video:

Warning, I am planning a release of the code in the next days.

Dominique

Terry D

unread,
Sep 15, 2019, 2:21:59 PM9/15/19
to Raspberry Pi Film Capture
The quality looks great! I will definitely try both when I finally have this all set up.

Is this with V1 camera? And what lens are you using?

I will keep an eye for new code release.

Dominique Galland

unread,
Sep 15, 2019, 2:49:23 PM9/15/19
to Raspberry Pi Film Capture
The video is with the V2
On this sequence the V2 has no color problem but now I use the V1
I have a 35mm lens.
 Google translate my doc for more details.

Sean Dungan

unread,
Sep 15, 2019, 4:21:08 PM9/15/19
to Raspberry Pi Film Capture
Thank you in advance for sharing the code! Your results are impressive. 

Would you mind pointing me to specifics about your lens mount and lens tube? This has been our biggest stumbling block. For some reason we are having trouble with google translate...

Thanks!

Sean

Gerhard Schindler

unread,
Sep 16, 2019, 1:12:39 AM9/16/19
to Raspberry Pi Film Capture
very nice quality, Dominique!

I'm looking forward to your code.
Gerhard

Dominique Galland

unread,
Sep 16, 2019, 5:36:23 AM9/16/19
to Raspberry Pi Film Capture
@Sean
For the video, note that there is some post processing, here with Fred's avisynth scripts.

If you can not translate the doc see the pictures.
You have two basic choices:
- Camera V1 or V2
- Stock lens adjusted and augmented with a close-up lens or an M12 or CS mount with a suitable lens and some extension rings
And next mounting in front of or behind the film, it depends on the space available with your projector

I did not study at all the first solution my lens is a 35mm CS mount, reverse mount behind the film.
For a 8mm image it gives:
- 30mm extension rings
- Distance Lens Ring / Sensor 46mm Distance Front Lens Face / Image 61mm
- Total distance Image / sensor 141 mm

Finally I have released minor changes to the code, this is the version I am currently using.

Terry D

unread,
Sep 18, 2019, 8:11:01 PM9/18/19
to Raspberry Pi Film Capture
Do you have a link for the 35mm lens you are using please? Can super 8 frame fill the sensor area with this lens? I have tried using triplet lens as suggested by Joe, but not had much success.

Dominique Galland

unread,
Sep 19, 2019, 6:52:53 AM9/19/19
to Raspberry Pi Film Capture
I do not have the exact reference of the 35mm lens, it comes from Arducam / UcTronics 10MP 35 MM Lens. (about 46$)
 It has an aperture 1.7 - 18 and a very small possibility of adjusting Near / Far.
With 30mm extension rings this fills exactly the sensor.
I also know that some people have tried a lens with variable focal length for more adjustment possibility but I have no experience about it

Renny Vihava

unread,
Sep 30, 2019, 2:36:50 AM9/30/19
to Raspberry Pi Film Capture
Hi and thanks for making another great project. But I can´t get it to work, gives me an error (on Raspberry) "NameError: name ´TAKE_BGR` is not defined". What could be the problem (besides that I´m not a coder myself and can just barely understand what´s going on with the code)?

Dominique Galland

unread,
Sep 30, 2019, 5:56:40 AM9/30/19
to Raspberry Pi Film Capture
Sorry a mistake in releasing the code.
Update Constants.py in yart/Common
Regards

Renny Vihava

unread,
Sep 30, 2019, 12:08:51 PM9/30/19
to Raspberry Pi Film Capture
Merci :-)
Now the software side seems to work, at least it gets connected, now all is left to do is to get some movement into the motor..maybe wiring problem.

Dominique Galland

unread,
Sep 30, 2019, 1:00:49 PM9/30/19
to Raspberry Pi Film Capture
Which controler and pins do do you use ?

Renny Vihava

unread,
Sep 30, 2019, 3:15:43 PM9/30/19
to Raspberry Pi Film Capture
I´ve tried A4988 and drv8825, 
ena_pin = 17, dir_pin = 18, pulse_pin = 23, trigger_pin = 24 just like I figured out from the code. I have too TB6600 but it´s a bit harder to wire because of those connectors.

I got A4988 working with Joe`s code and scanned fine few reels..but with your program I cannot get any life in my motor. 


Dominique Galland

unread,
Sep 30, 2019, 5:37:05 PM9/30/19
to Raspberry Pi Film Capture
I dont have tried a 8825
According to this doc:
that's what I'll try :

To set the motor ON 
ENA should be LOW or unconnected -> left unconnected
RST/SLP should be HIGH ->connect both RST/SLEEP to RPI pin 17 and in my interface set ON 17 and check High checkbox
Or may be:
Connect RST/SLP to VDD 3.3V
Connect ENA to RPI 17 and in my interface set ON 17 and uncheck High checkbox
When you press the Motor ON button you must hear the motor turn on




Renny Vihava

unread,
Oct 1, 2019, 3:49:12 AM10/1/19
to Raspberry Pi Film Capture
Oh yes, motor is turning now with that second wiring suggestion. But quite randomly, it responds to commands but keeps turning on it's own unless I turn it off. I've tried different high/low settings on different pins and changed steps per revolution etc..  And this with 8825, with 4988 I had no luck at all, maybe I'll try to wire that tb6600 and give it a try. But thanks again for helping me out.

Dominique Galland

unread,
Oct 1, 2019, 4:07:05 AM10/1/19
to Raspberry Pi Film Capture
No need to change controller and pins. For the High/Low settings change DIR if the direction FWD/BCK is not good and STEP should be HIGH 
Can you tell me exactly what you do when the motor does not stop: FWD BCK FWDOne BCKOne OnTrigger or Capture?
Which are the functions that work and the ones that do not work ?

Dominique Galland

unread,
Oct 1, 2019, 8:41:00 AM10/1/19
to Raspberry Pi Film Capture
Steps by rev:
By default a stepper motor turn at 200 steps / rev, that's what you need to enter in the interface.
Changing step / rev does not change the speed of the motor but it can be useful only a second time by reducing the vibrations. 
To change steps / rev you must first change the state of the pins that control it on the controller (or switches on the TB6600) and enter the new value in the interface

Trigger
When FWD / BCK FWD / BCKOne is running, try OnTrigger the motor must advance until the detection of the trigger (High or Low trigger depends on your trigger)

Camera
After all this open the camera and capture an image "Shot"

Dr. Günther Happersberger

unread,
Jan 23, 2020, 12:31:50 PM1/23/20
to Raspberry Pi Film Capture
Dear Dominique,
I'm trying to do a code walkthrough, your code looks perfectly structured and clear. When I start controller.py I'm failing because of missing *.npz files (* e.g. motor.npz). Where and how can I find my mistake?

Any answer would be appreciated.

Best reagrds

Günther

Dominique Galland

unread,
Jan 30, 2020, 12:07:36 PM1/30/20
to Raspberry Pi Film Capture
Dear Günther

Sorry, I missed your post. Thank you for your remark on my code (it was my job at the University).
It is normal to not have the npz files at the first run of the program,
These files save the camera and motor settings
it is not a fatal error, the program should continue and the npz files (motor.npz and camera.npz)  will be created later.
Do not hesitate if you have other questions about the project.

Dominique

Renny Vihava

unread,
Feb 11, 2020, 12:56:04 PM2/11/20
to Raspberry Pi Film Capture
It's been a while and now I'm back with this project..motor is doin quite what it should be doing. But when I try to open the camera, I get
"File "TelecineApplication.py", line 177, in openCamera
    calibrationMode = CALIBRATION_NONE
NameError: global name 'CALIBRATION_NONE' is not defined"

what am I missing here..?
Renny



Dominique Galland

unread,
Feb 11, 2020, 1:49:28 PM2/11/20
to Raspberry Pi Film Capture
CALIBRATION_NONE is defined in the source file Common / Constants.py which must be present on both the PI side and the PC side
 Be careful to take back all the sources:
- On the PI Common and Raspberry directories
- On the PC Common and GUIControl directories
Regards
Dominique

Alain Doublet

unread,
Feb 20, 2020, 4:41:11 PM2/20/20
to Raspberry Pi Film Capture
Dear Galland,
Have you try the client side (GUIControl)on a Linux machine?
I made this choice but I got a segmentation fault when capture (frame or trigger)started...

Is you windows version complant with Ubuntu for instance ?
Many thanks for your grezt job !

Ryan Garrel

unread,
Feb 27, 2020, 2:15:55 PM2/27/20
to Raspberry Pi Film Capture
Bonjour Dominique !
I have a problem with your software connecting the 2 devices.
Installed everything as you described.
PC: Win7 start telecineapplication.py with 1 warning (or error?)

Started on Raspberry:
pi@raspberrypi:~ $ sudo pigpiod
pi@raspberrypi:~ $ python3 Controller.py

Then after fill in of the ip-adres of the raspberry, click on connect.
Se error below.
Strange that it is the statement before the one you commented out.
After the second click the Raspberry side cancelled, see below.
(maybe a empty message ?)
Sorry, but I can't figure out what went wrong.
A bit of help is appreciated, I know how to program.
Thank you !

C:\FILM_DIGITALISEREN\yart-master\GUIControl>python telecineapplication.py
Object arrays cannot be loaded when allow_pickle=False
This was state when started and no click on connect was done

first time click on connect
<class 'AttributeError'>
module 'cv2.cv2' has no attribute 'xphoto'
<traceback object at 0x0491A3F0>
Traceback (most recent call last):
  File "telecineapplication.py", line 559, in connectDisconnect
    self.connect()
  File "telecineapplication.py", line 570, in connect
    self.imageThread = ImageThread(self.ip_pi)
  File "C:\FILM_DIGITALISEREN\yart-master\GUIControl\ImageThread.py", line 39, i
n __init__
    self.simpleWB = cv2.xphoto.createSimpleWB()
AttributeError: module 'cv2.cv2' has no attribute 'xphoto'

2nd time click on connect
<class 'AttributeError'>
module 'cv2.cv2' has no attribute 'xphoto'
<traceback object at 0x0491A4B8>
Traceback (most recent call last):
  File "telecineapplication.py", line 559, in connectDisconnect
    self.connect()
  File "telecineapplication.py", line 570, in connect
    self.imageThread = ImageThread(self.ip_pi)
  File "C:\FILM_DIGITALISEREN\yart-master\GUIControl\ImageThread.py", line 39, i
n __init__
    self.simpleWB = cv2.xphoto.createSimpleWB()
AttributeError: module 'cv2.cv2' has no attribute 'xphoto'
finally

=============
Raspberry side

pi@raspberrypi:~ $ sudo pigpiod
pi@raspberrypi:~ $ python3 Controller.py
Command sock connected
This was state after first click connect


Then after second click connect:
Image sock connected
SendImageThread started
SendImageThread terminated
Stop
Traceback (most recent call last):
  File "Controller.py", line 412, in <module>
    request = commandSock.receiveObject()
  File "/home/pi/MessageSocket.py", line 72, in receiveObject
    s = self.receiveString()
  File "/home/pi/MessageSocket.py", line 60, in receiveString
    return self.receiveMsg().decode()
AttributeError: 'NoneType' object has no attribute 'decode'

Ryan Garrel

unread,
Mar 2, 2020, 1:34:02 PM3/2/20
to Raspberry Pi Film Capture
Hi again,
un petit peu avancé ....
In program ImageThread.py:

        self.simpleWB = cv2.xphoto.createSimpleWB()
#        self.simpleWB = cv2.xphoto.createGrayworldWB()
        self.clipLimit = 1.
        self.reduceFactor = 1;
I commented self.simpleWB = cv2.xphoto.createSimpleWB()
Removed the dot.
And removed the ;
(Error is bizarre as in the statements before cv2 is also referenced, so it must be loaded correctly).

Now I can connect to the Raspberry, yeah !
Tried the motorfunctions.
Motor stuttering.
Blew up the driver.
Waiting for replacement :-(
(Wrong connection of Direction).

Trying to open camera.
Well, Then I get: Attrubte error, can't set attribute.
And that is cam_analog=1.
Well, I think I need a camera update, mine is V1 hardware version 1.3.
Waiting for replacement :-)

So far.

Dominique Galland

unread,
Mar 2, 2020, 2:55:53 PM3/2/20
to Raspberry Pi Film Capture
Hello Ryan,

I made some changes in my project, code, you need to update.
To have xphoto you must install opencv-contrib
pip install opencv-contrib-python
But these lines are not useful, I deleted them. xphoto is no longer required
For analog_gain, the attribute is not writable with picamera 1.13 standard, i also deleted.this line
Note: After the experimental version of picamera from Richard Bowman is necessary if you want to calibrate. See my doc
For the motor controller see also my doc. I recommend the more secure TB6600.

Regards
Dominique

Ryan Garrel

unread,
Mar 5, 2020, 12:19:51 PM3/5/20
to Raspberry Pi Film Capture
Hi Dominique,
here an update of the Adventure ....
I bought a TB6600 and the steppermotor is now running smoothly.
Learning a lot, never used a stepper before.
I wanted to be certain that the hardware is functioning before going to the imaging part.
Camera ON switch is working fine now with my version 1 camera, I get picture and capture in preview mode.
So now I'll have to read thouroughly your documentation about that.
And to make the tubes for the lens.

Thank you for continuing supporting this group, as often groups are abandoned after the first few months.
Thank you also for the software, this is so covenient not to have to make it yourself !

Ryan Garrel

unread,
Mar 5, 2020, 7:19:14 PM3/5/20
to Raspberry Pi Film Capture
Hmm.. next steps.
My systems: Win7 32-bit. Raspi 3b+.
New TelecineApplication acted weird with Raspi.
Saving data on PC: the first image gave a right violation for the directory.
Restarted under administrator. Nothing was saved under capture.
Starting-stopping motor was ok, but after capture did not stop, had to stop Controller on Raspi, which could not be stopped, so I had to disable the terminal. Then I had to reconnect to restart the queues.
Message on PC: one connection was terminated by Raspi.

So decided to renew python as you describe in your text.
Installed python 3.8.2 side by side with version 3.7.6.
Got errors, see below.
Removed 3.7.6 and 3.8.2.
Re-installed 3.8.2.
The pip for mathplotlib should be matplotlib without h (this was in 3.7.6)
So everything installed correctly.
All installs i have done under administrator.
Same error as before:

C:\FILM\yart-master\GUIControl>python TelecineApplication.py

Traceback (most recent call last):
  File "TelecineApplication.py", line 10, in <module>
    from PyQt5.QtWidgets import QDialog, QApplication, QSpinBox, QFileDialog
ImportError: DLL load failed while importing QtWidgets: %1 is geen geldige Win32
-toepassing.
"%1 is geen geldige Win32-toepassing" means not a valid Win32-application.

Bizarre...
Looking in:
C:\Program Files\Python38-32\Lib\site-packages\PyQt5\bindings\QtWidgets
QDialog, QApplication, QSpinBox, QFileDialog, sips are all present.

But which dll it concerns ?

Dominique Galland

unread,
Mar 6, 2020, 5:06:25 AM3/6/20
to Raspberry Pi Film Capture
Your installation of Python under windows does not look correct, perhaps a mixture between an installation in the "Programs" directory and a User directory.
For me Python is installed in:
C: \ Users \ Dominique \ AppData \ Local \ Programs \ Python \ Python38
This directory is added in the PATH variable
Check with
echo% PATH%
and
python --version
Then the libraries are installed in the same directory, it's the simplest, but you can also install  and run virtualenv and install the libraries in a virtual environment.
To test the camera it is preferable to capture a single "Shot" image, after only we can try "Preview" and only again after "Capture" with the motor.
Choose a correct directory for the "Save" option
Yes, if the programs crash, the motor can continue to run because the PWM pulses continue to be sent by the pigpiod daemon
Regards
Dominique

Ryan Garrel

unread,
Mar 7, 2020, 6:17:00 PM3/7/20
to Raspberry Pi Film Capture
Bonjour Dominique,
the continuing story...
Uninstalled python 3.7
Same error message.
Looked to %PATH% as you suggested.
Indeed, first in path was 3.8, but second 3.7.
Looked in user directory: nothing.
Looked in program files.
Dir 3.7 was not removed completely, a big residue remained.
Then deleted dir 3.7.
UnInstalled 3.8.
Removed dir 3.8 from program files.
Scanned registry, deleted all pointers to 3.7 or 3.8.
So, system is clean.
Re-installed 3.8 with the other parts.
Same error.
Searched internet:
https://stackoverflow.com/questions/42880859/importerror-dll-load-failed-the-specified-module-could-not-be-found-failed-to
https://github.com/pyinstaller/pyinstaller/issues/2152
It seems to be the same problem as in an earlier version.
What can I do ?
Are there any crucial changes you need in 3.8 compared to 3.7 ?
If I could go back to 3.7 that would be fine, as that version worked without any problem.
Thank you again for your attention !

Dominique Galland

unread,
Mar 8, 2020, 1:47:49 PM3/8/20
to Raspberry Pi Film Capture
The only requirement is Python 3.
For a long time since the beginning of the project I used Python 3.7 and libraries from a year ago.
Recently I wanted to see if everything worked with Python 3.8 and the most recent libraries.
For me everything still works correctly but you can certainly stay with Python 3.7.
Regards

Ryan Garrel

unread,
Mar 9, 2020, 7:24:54 PM3/9/20
to Raspberry Pi Film Capture
Okay, removed Python 3.8, re-installed 3.7.
Up and running !
Still lots to find out about all the parameters.
It continues...
Thanks again !

PS. In your description of the project:

Sur le PC Windows

  • Python 3.8.2
  • pip install mathplotlib
That must be matplotlib (as it was in your previous description).

David

unread,
Mar 25, 2020, 11:43:59 PM3/25/20
to Raspberry Pi Film Capture
Hello Dominique,

Thank you for all for effort supporting this project! I am currently working with someone that is having trouble getting the software to work correctly. The motors move and the camera takes pictures,
 but when the software is set to OnFrame, the software acts like it is missing the reed switch signals.
I wrote a quick script to verify that the raspberry pi does indeed see the sensor and i was getting reliable 0's and 1's. But when the software is running, it acts like only sees 1 in every 8 - 12 reed switch signals. I tried slowing down the motor, thinking perhaps the software didn't check the pin often, but there was no improvement. I didn't get any errors on the pc side of things, but the motor would continue spinning like the script on the pi was stuck.

Any ideas?

Thanks in advance,

David 

Jacques Charrat

unread,
Mar 30, 2020, 12:12:14 PM3/30/20
to Raspberry Pi Film Capture
Bonjour Dominique,

I would like to start this adventure.
Is there somewhere a wiring diagram that includes the TB6600?
Thanks in advance!

Slowtraincoming

unread,
May 28, 2020, 8:52:15 AM5/28/20
to Raspberry Pi Film Capture
This is fantastic.
I am a complete novice when it comes to all of the skills (coding, engineering etc) required to pull off a project like this...but I have a gutted projector, raspi, etc and I think I want to give it a go.
First though, can the the computing part be handled by a Mac or is the lack of a PC a non starter?

Thanks so much.

Dominique Galland

unread,
May 28, 2020, 8:59:50 AM5/28/20
to Raspberry Pi Film Capture
The client part is in Python, so there should be no problem using a Mac.
Perhaps other members of this group have this experience?

Dan Monaghan

unread,
Jun 1, 2021, 5:47:08 AM6/1/21
to Raspberry Pi Film Capture

Mac user here, using the Brew package manager I've had no problem installing Yart. Standard issues of just getting the correct pip3 dependencies, but no surprises .
Reply all
Reply to author
Forward
0 new messages