How to Invert the Pi Camera Video

Discussion about this major DATV Project. See https://wiki.batc.org.uk/The_Portsdown_Transmitter
Post Reply
G8GKQ
Site Admin
Posts: 2811
Joined: Sun Mar 22, 2009 1:21 pm

How to Invert the Pi Camera Video

Post by G8GKQ » Mon Jul 17, 2017 7:08 pm

I met Simon M0ZSU at the Reading Rally this weekend and he mentioned that he had had some success with using an HDMI-to-CSI2 adapter to feed the output of an HDMI Camera into the Pi Camera port on a Portsdown Transmitter. I think that it was a development of this device http://auvidea-pcb.com/index.php/theme- ... pi-hdmi-in - perhaps Simon could confirm?

The one problem that he had faced was that the transmitted picture was the wrong way up and he asked if it was possible to flip it. Here are details of how to do the flip - not for the faint-hearted!

Edit the file /home/rpidatv/src/bin/avc2ts.cpp and change line 1014 to read:

Code: Select all

setMirror(OPORT_VIDEO,OMX_MirrorVertical);
(You may need OMX_MirrorBoth instead of OMX_MirrorVertical)

Then execute the following commands:

Code: Select all

cd /home/pi/rpidatv/src/avc2ts
make clean
make
sudo make install
cd ~
Then restart the console or the touchscreen and the transmitted video in CAMH264 mode will be flipped. The touchscreen does not appear to be able to cope with this and only displays a single still image - that's a challenge for someone else to sort out!

I must stress that the adapter required for this costs over £100 and is totally unrelated to our use of HDMI leads as Pi Camera extension cables.

Simon - please could you provide more details of your converter board?

Dave, G8GKQ

borzwatson
Posts: 9
Joined: Mon Feb 13, 2017 3:29 pm

Re: How to Invert the Pi Camera Video

Post by borzwatson » Tue Aug 01, 2017 3:40 pm

Hi Dave,

Thank you very much for posting the info.

No, the card I have is actually the B100 HDMI-CSI2 bridge
http://auvidea-pcb.com/index.php/theme- ... i-2-bridge

I haven't had a chance to try the software patch but hope to very soon.

Will update here when I have.

Thanks and 73

Simon M0ZSU

borzwatson
Posts: 9
Joined: Mon Feb 13, 2017 3:29 pm

Re: How to Invert the Pi Camera Video

Post by borzwatson » Tue Mar 19, 2019 1:49 pm

Hi,

Recently I have resumed work on getting the HDMI camera I have to work with Portsdown via the adpater card mentioned earlier in this post.
The good news is the new Stretch version of Portsdown does not suffer the locking up problem when using the adapter card I have, and I have linked the camera via serial interface to the Pi and found that it has a command to flip the image - which works!
In light of this, I would like to ask please, is there a way of getting the Portsdown software to run scripts, for example each time the TX soft button is pressed? Failing that can one add their own function buttons?

Many thanks and 73, still enjoying this project!

Simon M0ZSU

G8GKQ
Site Admin
Posts: 2811
Joined: Sun Mar 22, 2009 1:21 pm

Re: How to Invert the Pi Camera Video

Post by G8GKQ » Tue Mar 19, 2019 2:02 pm

Hi Simon

Pleased to hear that the Stretch version is better for you. If you want a script run before each transmission, the easiest thing to do is to slot it in somewhere near line 443 in rpidatv/scripts/a.sh. This is the main script that is called to make the transmission happen. Probably easiest to source a separate script to sort out the HDMI camera, then you can edit that script alone without having to make too many changes to a.sh.

Custom function buttons are more difficult as this would mean a major change to the gui program and recompilation.

If you could share technical details of the camera hardware and your software modifications we could consider putting the changes that you need in the main production build so that they are available to the rest of the community.

Dave, G8GKQ

borzwatson
Posts: 9
Joined: Mon Feb 13, 2017 3:29 pm

Re: How to Invert the Pi Camera Video

Post by borzwatson » Thu Mar 21, 2019 1:15 pm

Hi Dave,

Many thanks for the info. I am calling a python script from a.sh which seems to work well, thank you.
I notice there is a b.sh which appears to be a stop transmission, but I don't think the GUI program calls that when you stop transmitting - is that assumption correct? if so is there another script which is ran when transmission is ceased?

Another question, how are the touchpad presses fed to the GUI, or is that all internally handled in the c code for the GUI?
Just that I can also pick up remote control codes from the camera's remote (infra red remote) and if there is a way I could tell the GUI to stop/start transmit or simulate a touch pad press for TX I could implement that on the remote - but now I am just getting carried away I think... :-)

Once I have tidied it up I will take a picture of the whole setup and post the camera hardware details on here.

73, thanks again for the assistance.

Simon M0ZSU

G8GKQ
Site Admin
Posts: 2811
Joined: Sun Mar 22, 2009 1:21 pm

Re: How to Invert the Pi Camera Video

Post by G8GKQ » Fri Mar 22, 2019 9:58 am

Hi

You are correct, b.sh is not called by the GUI, as there is some additional tidying up to do with the touchscreen that needs to be handled within the gui program, so all the stop-transmit system commands are called internally.

The touchscreen commands are all handled internally, but there is another way. In the next release (and in the current dev release if you want to try it) are 2 scripts a_remote.sh and b_remote.sh. These comprehensively handle all the start and stop transmit functions (only). I do not have a script to reactivate the touchscreen after their use yet, but guess I need to write one.

Sounds interesting!

Dave

Post Reply

Return to “The Portsdown Digital ATV System”