Home and Links
 Your PC and Security
 Server NAS
 DVD making
 Raspberry Pi
 PIC projects
 Other projects
 Next >>

RCA output

Pi RCA out


How do I enable the RCA socket (AV 'TV video' out) ?

Whilst the Pi system supports as many as 8 'text terminals', you can only have ONE 'graphics' (video) terminal window. This is because, essentially, the Pi GPU can only generate ONE video output stream at a time - and the choice is analogue (RCA) or digital (HDMI), and that's that

CCTV 'video tape' recording systems are fitted with 4 or 8 RCA inputs for analogue CCTV cameras generating grey-scale AV data stream.
Since they are all based on US video standards, the camera AV signal is typically some fraction of the NTSC resolution (1/4 NTSC being the old standard, although many systems will also support full NTSC resolution and some even PAL).
If you are using your Pi camera with such a system, you will need to enable the RCA AV output (and set it to NTSC)
Modern CCTV systems are hard disk based and accept digital data streams, however the connection is typically via an Ethernet cable. Such systems are outrageously expensive, so, unless you already have one, it's (much) cheaper to use a dedicated PC (along with the iSpy software)
Note = there is nothing to stop you using the camera to take full resolution photos and showing these on a 'local' (low resolution) TV display, whilst, at the same time, transmitting the high resolution photos via Ethernet to your PC (the Pi GPU will re-size your photos to fit the display)

How hard can it be to get RCA out ?

Extremely - you have AT LEAST 3 places where the output 'path' is set by a 'config' - system, user and application - and which-ever of these is run last will 'over-ride' all the others.

Setting the system config

In the 'good old days' of Wheezy, the 'default' video out was RCA, but the Pi would (try to) 'auto sense' the presence of a HDMI screen at start up and 'auto-switch' to the HDMI socket.

The problem with this is, if you are a bit late in turning on your (HDMI) screen, or you are using a HDMI-DVI 'converter' (many of which failed to send the 'sense' data) or a HDMI-VGA 'converter' (none of which support 'sense') the Pi would stay in RCA 'mode' the new user would see a (blank) digital screen and start throwing fits.
This was especially 'annoying' to the new user, since even those who had carefully followed the 'turn on the (HDMI) screen first' instruction would soon slip-up (or unplug the PI from their living room TV and plug in an old DVI / VGA screen with converter) and, on being presented with a blank screen, assume their Pi was faulty and start demanding refunds

So, how did the Pi foundation 'fix' this ? Well, it's not 'unreasonable' to assume that whatever you started with (analogue TV or HDMI) is what you would continue with - so when 'NOOBS' came along that's exactly what they did. If you first start-up NOOBS with HDMI, 'NOOBS' would self configures into a 'force HDMI' mode.

To return NOOBS to the 'detect at power-on' state, you need to edit /boot/config.txt file (from a terminal window). If you no longer have access to a HDMI screen (or screen + converter), then you will have to 'log in' remotely eg from a PC running 'putty' or similar)

sudo nano /boot/config.txt
Find the line "hdmi_force_hotplug=1", and add a # in front of the line to 'comment it out' (might as well comment out drive as well) :-
Now locate the 'SDTV mode' and 'SDTV aspect' settings and set them as needed (most likely PAL, 4:3) :-
#sdtv_mode defines the TV standard for composite output (default=0)
#sdtv_mode=0    #Normal NTSC (use mode 0 if your Pi camera is being used with a CCTV tape recording system)
#sdtv_mode=1    #Japanese version of NTSC  no 'pedestal' in wave form
# set normal PAL (local or remote TV)
#sdtv_mode=3    #Brazilian version of PAL  525/60 rather than 625/50, different subcarrier
#sdtv_aspect defines the aspect ratio for composite output
# set 4:3
#sdtv_aspect=2 # 14:9
#sdtv_aspect=3 # 16:9

Disable the 30min screen blanking 'screen saver'

By default, the Pi will 'blank' it's GUI display after 30 mins of 'inactivity'. Since you are likely controlling the camera via a script or from a remote terminal (and not some locally connected keyboard/mouse) the RCA output will always cut off 30 mins after boot-up :-)

From PuTTY you can use the 'sudo setterm -blank 0 -powerdown 0' command, however that only applies for the 'current session'.
A more permanent solution is to edit (sudo nano) the file "/etc/kbd/config" and change the following entries to the values shown :-
# blank 0 means never
# DPMS is the energy star garbage, no effect on TV out, but turn it off anyway in case you every switch to a local HDMI display
# powerdown 0 means never

OpenELEC (this is now known as 'KODI' = see later)

Yep, OpenELEC 'overrides' whatever the system is set to = and forces HDMI. To fix this, you need to go find the OpenELEC /flash/config.txt file, which (of course) is 'read only' (to stop NOOBS mucking around with what they don't understand :-) )

To modify OpenELEC /flash/config.txt, you need to remount the /flash/ directory as "rw" using a terminal window. The easiest way is to use a PC with PuTTY :-

launch the putty.exe, enter the IP address of your Pi (if OpenELEC is running, look in System>System Info page, if not you may have to go look in your Router 'network connections' or similar). After entering the correct IP address (eg, click on 'connect' in Putty's window and you will be presented with a console.
The Pi user is :-
The password is :-
Remount /flash as read-write :-
mount -o remount,rw /flash
Open config.txt file in the 'nano' text editor :-
nano /flash/config.txt
To set OpenELEC so it will switch to RCA when no HDMI is 'sensed', modify the last 3 lines as follows :-
# hdmi_force_hotplug=1
# hdmi_ignore_hotplug=1
the first comments out 'force HDMI' the second comments out 'force RCA' (which would force composite video output, regardless of the HDMI 'sense'). the third line (mode=2) tells the Pi to use PAL video output (of which more later) Press CTRL+x to exit, then Y to 'confirm' you want to save the changes, the ENTER (to overwrite the config.txt file).

To make /flash read-only again :-

mount -o remount,ro /flash

NOTE that these changes will only take effect on a reboot


Putty on the PC will then complain about a 'lost connection' and 'log you out' of the Pi

NOTE that, after these changes, OpenELEC will use the RCA socket (so long as no HDMI device is discovered) .. and when it does, OpenELEC will feed it's audio to the 3.5mm jack connector !

What will I get out of the RCA connector ?

By default, mode=2, 'PAL' TV is 576 lines of 720 'equivalent' pixels (remember, the line data is analogue). Note, however, that the Pi Camera 'defaults' are 2592 x 1944 pixel static images and HD (1080p30, 720p60) or VGA 640x480p60/90 video.

Remember that the GPU is quite capable of 'rescaling' video 'on the fly', so it's quite possible the Pi Camera 640x480 will be 'scaled up' to 720x576 .. which might well result in a rather 'smoother' image that you are expecting :-) )

IF the camera is in HD mode, and IF you have a 'widescreen' TV, you will need to tell the Pi to set the 'aspect ratio' correctly (a standard TV id 4:£, so sdtv_aspect=1, however widescreen is 16:9, so sdtv_aspect=3)

sdtv_aspect=1 4:3 sdtv_aspect=2 14:9 sdtv_aspect=3 16:9

One final thing to note is that most CCTV systems are based on NTSC recorders (i.e the recorder is expecting 480 lines, not 576). To get NTSC (720x480) from the RCA socket, you need to set tv-mode 0

For more information on setting the Pi RCA output modes, visit this page

Next subject :- Pi Dash cam - (traffic and car secutiry camera)