InfamousVJ
Posts: 7
Joined: Thu Sep 06, 2018 1:25 pm

Remotely Output Images to 3 Video Sources

Thu Sep 06, 2018 2:19 pm

I am new to the Raspberry Pi world and I am overwhelmed with how to get started on a project that I want to complete.

I want to be able to remotely command the Raspberry Pi Zero via a USB connection to output stored images to one of three output sources: 1) HDMI 2) VGA 3) TV.
I currently have the TV output wired to a RCA composite video jack and I am using a VGA666 DPI module connected to the gpio pins.

I am at a loss on how to get started.
I would like to first be able to command the desired image to be output to any one of the three sources.
From that point, I would look into remotely commanding the same operation via a USB connection to an PC.

Any information provided would be greatly appreciated.
Thanks in advance!

User avatar
topguy
Posts: 4864
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Remotely Output Images to 3 Video Sources

Fri Sep 07, 2018 10:57 am

Do you have any programming background ? If so in which languages ?

InfamousVJ
Posts: 7
Joined: Thu Sep 06, 2018 1:25 pm

Re: Remotely Output Images to 3 Video Sources

Fri Sep 07, 2018 12:09 pm

My background is in Visual Studio applications and I am most comfortable in C/C++.
I have in the past maintained some Perl software and Unix scripts.
I am trying to understand how to accomplish this goal in this Linux setting, but I am having a hard time getting started.

procount
Posts: 1263
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Remotely Output Images to 3 Video Sources

Fri Sep 07, 2018 12:21 pm

Some questions spring to mind:
1) What is on the other end of the USB cable that will control the PiZero?
2) Do you only want to use the PiZero as a switch to route the video to only one interface at a time?
3) What sort of switching time between interfaces do you require?
3) Or do you expect to display a video on more than one interface at the same time (e.g. VGA and HDMI simultaneously)?
4) If so, are you expecting to have the same or different videos on each interface?

The video questions are mostly asked because there are currently some limitations in the number of display devices you can use at once, and some are only selectable at boot time. Although, JamesH's work on multiple frame buffers (https://www.raspberrypi.org/forums/view ... 3&t=216399) may help in the future, it's still very much at beta stage.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

InfamousVJ
Posts: 7
Joined: Thu Sep 06, 2018 1:25 pm

Re: Remotely Output Images to 3 Video Sources

Fri Sep 07, 2018 7:50 pm

procount wrote:
Fri Sep 07, 2018 12:21 pm
Some questions spring to mind:
1) What is on the other end of the USB cable that will control the PiZero?
2) Do you only want to use the PiZero as a switch to route the video to only one interface at a time?
3) What sort of switching time between interfaces do you require?
3) Or do you expect to display a video on more than one interface at the same time (e.g. VGA and HDMI simultaneously)?
4) If so, are you expecting to have the same or different videos on each interface?

The video questions are mostly asked because there are currently some limitations in the number of display devices you can use at once, and some are only selectable at boot time. Although, JamesH's work on multiple frame buffers (https://www.raspberrypi.org/forums/view ... 3&t=216399) may help in the future, it's still very much at beta stage.
1) I wanted to control the RPiZero using a PC/laptop running a Windows OS.
2) Yes, I will only expect to output one image at a time on one of the 3 interfaces.
3a) The transition time is not of importance in this application.
3b) I only need one interface to source at a time.
4) Only need to command one interface at a time and then transition between stored images.

procount
Posts: 1263
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Remotely Output Images to 3 Video Sources

Fri Sep 07, 2018 9:03 pm

1) I wanted to control the RPiZero using a PC/laptop running a Windows OS.
You can use OTG ethernet gadget and talk to it like a network, or as a serial port, both over usb.
2) Yes, I will only expect to output one image at a time on one of the 3 interfaces
.
That's good.
3a) The transition time is not of importance in this application.
Switching between hdmi and tv is ok and quite quick. To switch to/from dpi needs a reboot at the moment. Unless you can make use of the beta software mentioned above. Some software like omxplayer can output to various screens without rebooting.
3b) I only need one interface to source at a time.
Good that makes it easier.
4) Only need to command one interface at a time and then transition between stored images.
Is an image a photo/picture or a video?

It certainly looks feasible. Choose a display program that can output to different fisplays like omxplayer, and decide how to receive the switch command from your pc: ethernet, serial, web browser - there are several options.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

InfamousVJ
Posts: 7
Joined: Thu Sep 06, 2018 1:25 pm

Re: Remotely Output Images to 3 Video Sources

Tue Sep 11, 2018 3:01 pm

I am unable to use tools like fbi and fmi because the RPi is stating that these commands are not found.

Whenever I attempt the following, I receive failed to fetch errors of mirrordirector:

Code: Select all

sudo apt-get install fbi
sudo apt-get install fmi
I am using a RPi Zero and I do not have an Ethernet connection.
How can I attempt to use these commands?

I am still unable to output image files to the three different output source types.
I tried the omxplayer command, but that appears to be useful with video files only.
I am trying to output static images to the sources (i.e. *.png, *.bmp, *.jpg, etc files).

User avatar
topguy
Posts: 4864
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Remotely Output Images to 3 Video Sources

Tue Sep 11, 2018 4:57 pm

Show us the errors in addition to the command, or else we are mostly guessing.
Always do "apt-get update" first too.
Sometimes the mirrrordirector has a hiccup or direct you to a mirror that is not working, try again later.

InfamousVJ
Posts: 7
Joined: Thu Sep 06, 2018 1:25 pm

Re: Remotely Output Images to 3 Video Sources

Tue Sep 11, 2018 5:57 pm

topguy wrote:
Tue Sep 11, 2018 4:57 pm
Show us the errors in addition to the command, or else we are mostly guessing.
Always do "apt-get update" first too.
Sometimes the mirrrordirector has a hiccup or direct you to a mirror that is not working, try again later.
These are the errors that I see when executing the commands previously discussed:

Code: Select all

[email protected]:~ $ sudo apt-get update
Err:1 http://archive.raspberrypi.org/debian stretch InRelease
  Temporary failure resolving 'archive.raspberrypi.org'
Err:2 http://mirrordirector.raspbian.org/raspbian stretch InRelease
  Temporary failure resolving 'mirrordirector.raspbian.org'
Reading package lists... Done                 
W: Failed to fetch http://mirrordirector.raspbian.org/raspbian/dists/stretch/InRelease  Temporary failure resolving 'mirrordirector.raspbian.org'
W: Failed to fetch http://archive.raspberrypi.org/debian/dists/stretch/InRelease  Temporary failure resolving 'archive.raspberrypi.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.
[email protected]:~ $ 

Code: Select all

[email protected]:~ $ sudo apt-get install fbi
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  ghostscript libgs9 libgs9-common libijs-0.35 libjbig2dec0 libpaper-utils
  libpaper1
Suggested packages:
  imagemagick ghostscript-x
The following NEW packages will be installed:
  fbi ghostscript libgs9 libgs9-common libijs-0.35 libjbig2dec0 libpaper-utils
  libpaper1
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 7,152 kB of archives.
After this operation, 22.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Err:1 http://mirrordirector.raspbian.org/raspbian stretch/main armhf libijs-0.35 armhf 0.35-12
  Temporary failure resolving 'mirrordirector.raspbian.org'
Err:2 http://mirrordirector.raspbian.org/raspbian stretch/main armhf libjbig2dec0 armhf 0.13-4.1
  Temporary failure resolving 'mirrordirector.raspbian.org'
Err:3 http://mirrordirector.raspbian.org/raspbian stretch/main armhf libpaper1 armhf 1.1.24+nmu5
  Temporary failure resolving 'mirrordirector.raspbian.org'
Err:4 http://mirrordirector.raspbian.org/raspbian stretch/main armhf libgs9-common all 9.20~dfsg-3.2+deb9u1
  Temporary failure resolving 'mirrordirector.raspbian.org'
Err:5 http://mirrordirector.raspbian.org/raspbian stretch/main armhf libgs9 armhf 9.20~dfsg-3.2+deb9u1
  Temporary failure resolving 'mirrordirector.raspbian.org'
Err:6 http://mirrordirector.raspbian.org/raspbian stretch/main armhf ghostscript armhf 9.20~dfsg-3.2+deb9u1
  Temporary failure resolving 'mirrordirector.raspbian.org'
Err:7 http://mirrordirector.raspbian.org/raspbian stretch/main armhf fbi armhf 2.10-2+b1
  Temporary failure resolving 'mirrordirector.raspbian.org'
Err:8 http://mirrordirector.raspbian.org/raspbian stretch/main armhf libpaper-utils armhf 1.1.24+nmu5
  Temporary failure resolving 'mirrordirector.raspbian.org'
E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/i/ijs/libijs-0.35_0.35-12_armhf.deb  Temporary failure resolving 'mirrordirector.raspbian.org'
E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/j/jbig2dec/libjbig2dec0_0.13-4.1_armhf.deb  Temporary failure resolving 'mirrordirector.raspbian.org'
E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/libp/libpaper/libpaper1_1.1.24+nmu5_armhf.deb  Temporary failure resolving 'mirrordirector.raspbian.org'
E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/g/ghostscript/libgs9-common_9.20~dfsg-3.2+deb9u1_all.deb  Temporary failure resolving 'mirrordirector.raspbian.org'
E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/g/ghostscript/libgs9_9.20~dfsg-3.2+deb9u1_armhf.deb  Temporary failure resolving 'mirrordirector.raspbian.org'
E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/g/ghostscript/ghostscript_9.20~dfsg-3.2+deb9u1_armhf.deb  Temporary failure resolving 'mirrordirector.raspbian.org'
E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/f/fbi/fbi_2.10-2+b1_armhf.deb  Temporary failure resolving 'mirrordirector.raspbian.org'
E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/libp/libpaper/libpaper-utils_1.1.24+nmu5_armhf.deb  Temporary failure resolving 'mirrordirector.raspbian.org'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
[email protected]:~ $

procount
Posts: 1263
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Remotely Output Images to 3 Video Sources

Wed Sep 12, 2018 12:52 am

I am using a RPi Zero and I do not have an Ethernet connection.
How can I attempt to use these commands?
You really need an internet connection to use apt-get - ethernet or wifi, which is why you are getting the errors complaining that it can't download the packages.
But if you cannot connect it to the internet, you can download the .deb packages mentioned in the error messages manually using a PC and transfer them to the RPi Zero with a USB stick, or via the SD card. Then you can install them using

Code: Select all

dpkg -i <package>.deb
instead.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

InfamousVJ
Posts: 7
Joined: Thu Sep 06, 2018 1:25 pm

Re: Remotely Output Images to 3 Video Sources

Fri Sep 21, 2018 2:41 pm

OK. I finally got some equipment in that allows me to connect the RPi0 to the internet.

Code: Select all

fim -a foo.jpg
This opens up separate screen to display the image.

However, I want this image to be output on the VGA 666 adapter that is connected to the GPIO which connects to a monitor.
...or the TV output which connects to a monitor.
...or eventually the HDMI output which is connected to a monitor.

Thanks for all the help thus far as it has been tremendous.
Any assistance on how to complete this task would is greatly appreciated.

InfamousVJ
Posts: 7
Joined: Thu Sep 06, 2018 1:25 pm

Re: Remotely Output Images to 3 Video Sources

Thu Oct 11, 2018 7:00 pm

Does anyone know of an easy way to switch the video output of my raspberry pi zero from HDMI output to the TV output?

I want to be able to remotely output an image from the HDMI output and the switch to the TV output (or vice versa).
Is there a way to accomplish this task without having to keep editing the config.txt and rebooting the device?

Any assistance is always appreciated.
Thanks

procount
Posts: 1263
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Remotely Output Images to 3 Video Sources

Thu Oct 11, 2018 11:49 pm

Use tvservice
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

aBUGSworstnightmare
Posts: 971
Joined: Tue Jun 30, 2015 1:35 pm

Re: Remotely Output Images to 3 Video Sources

Fri Oct 12, 2018 5:00 am

InfamousVJ wrote:
Thu Oct 11, 2018 7:00 pm
Does anyone know of an easy way to switch the video output of my raspberry pi zero from HDMI output to the TV output?

I want to be able to remotely output an image from the HDMI output and the switch to the TV output (or vice versa).
Is there a way to accomplish this task without having to keep editing the config.txt and rebooting the device?

Any assistance is always appreciated.
Thanks
not any application is able to do this.
You can i.e.make use of screen

Code: Select all

 screen -dmS vid1 sh -c 'omxplayer --display=4 --win "0 0 800 480" /home/pi/Videos/trailer_1080p.mov; exec bash'
screen -dmS vid1 sh -c 'omxplayer --display=2 --win "0 0 1280 1024" /home/pi/Videos/trailer_1080p.mov; exec bash' 
where the parameters used with --display=x will select the output device
MAIN_LCD 0
AUX_LCD 1
HDMI 2
SDTV 3

MAIN_LCD = DSI 7in display, AUX_LCD is DPI djsplay (as you use DPI for VGA).

You may want to test multiple framebuffer for this as well? Head over to https://www.raspberrypi.org/forums/view ... 3&t=216399 for details

procount
Posts: 1263
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Remotely Output Images to 3 Video Sources

Fri Oct 12, 2018 9:16 am

InfamousVJ wrote:
Thu Oct 11, 2018 7:00 pm
Does anyone know of an easy way to switch the video output of my raspberry pi zero from HDMI output to the TV output?
aBUGSworstnightmare wrote:
Fri Oct 12, 2018 5:00 am
not any application is able to do this.
Maybe you are still thinking about DSI switching (?) but here, I think the OP is specifically asking about switching between HDMI and SDTV through the composite output. They didn't mention VGA (through VGA666) which is another story.

In this case, tvservice can switch between these 2 video outputs.
Use `tvservice -h` to show all possible parameters.

To switch to TV output on the composite output:

Code: Select all

#e.g.
tvservice --sdtvon="PAL 4:3"
To switch back to HDMI output

Code: Select all

#e.g.
tvservice -p
#or more explicitly
tvservice -e "DMT 47 HDMI"
The "DMT" parameter is screen mode which could also be CEA
The values "47" is one of the available modes. Pick one that your monitor supports.
Use `tvservice -m DMT` or `tvservice -m CEA` to list the available modes.

In a lot of cases, when you switch from one output to another, the screen will be blank. In this case it is also necessary to refresh the framebuffer using something like:

Code: Select all

fbset -depth 32
fbset -depth 24
i.e. execute both of those commands.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

aBUGSworstnightmare
Posts: 971
Joined: Tue Jun 30, 2015 1:35 pm

Re: Remotely Output Images to 3 Video Sources

Fri Oct 12, 2018 9:56 am

procount wrote: They didn't mention VGA (through VGA666) which is another story.
infamousVJ did https://www.raspberrypi.org/forums/post ... #pr1368377

procount
Posts: 1263
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Remotely Output Images to 3 Video Sources

Fri Oct 12, 2018 10:40 am

Yes, I know he did initially, but I wondered if he had dropped that because he didn't mention it specifically in the last post....? TVservice is obviously not sufficient to switch to DSI/DPI and he'll have to use the other techniques we already mentioned.

No matter - he now has 3 different solutions so should be able to get something working ;)
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 35 guests