I can view videos using OMXPlayer:
omxplayer -o hdmi video.h264
How do I do the same for still images?
I can view videos using OMXPlayer:
omxplayer -o hdmi video.h264
How do I do the same for still images?
You can use the command-line fbi
app ("framebuffer image viewing"). The framebuffer is also what oxmplayer
uses. Fbi is available from the raspbian repos and should be in any other GNU/Linux distro as well; it is not specific to the pi.
It takes a filename or series of filenames, and you can use shell globbing for this, so e.g.:
fbi *.jpg
Will show all the .jpg files in your current directory. For instructions on how to advance from one picture in the list to the next, see the KEYS section of man fbi
. You can also set an automated slideshow with the -t
option.
You may get this error:
ioctl VT_GETSTATE: Invalid argument (not a linux console?)
Even when logged in on a VT. The solution is to specify the framebuffer device, which should be:
fbi -d /dev/fb0 [...]
If you are using ssh, try:
fbi -T 1 [...]
Where "1" is the number of your current VT ("virtual terminal", aka. VC, "virtual console"; these are accessed via ctrl-alt-F[1-6]
). You do not have to be logged in on the VT where the image will be displayed, so you can log in remotely and use this to put images on a display attached to the pi (presuming the correct VT is on screen). -T
is not in the man page, but it is listed with fbi --help
.
Note you cannot use this to view the image on a remote terminal; those aren't associated with the framebuffer.
A couple of other useful options are -a
, which will zoom the images to fit on the screen if they are too large, and --edit
, which allows you to rotate images (I believe they are then saved with that rotation, you may want to check that if it presents an issue).
Working cmdline for me (this way I display image on HDMI-monitor while connected to Rpi by ssh):
sudo fbi -T 2 img.jpg
As I was trying to write to a spi framebuffer with no VT attached comes up as /dev/fb2
http://www.hardkernel.com/main/products/prdt_info.php?g_code=G142060963922
fbi -T 1 -d /dev/fb2 -noverbose my.jpg
I found I needed to to use -T 1 to give fbi a VT it doesn't seem to matter which one
-noverbose was because I don't want text showing
I was running that command from within X11 which did have the side effect of temporarly overwriting the X11 buffer but the op and myself won't be running X11 it's not a issue, I was just testing the fb device for now
I don't really care about control as I just call fbi again when I want to show the next image
I was on a odroid C1 with openSUSE but that shouldn't matter
I found that 'sudo fbi -vt ' works.
You need to invoke 'sudo' to run fbi, to be able to access the actual virtual console which 'screen' is running on. (And hopefully you're not already running as root..!) :D
Sudo fbi -T -device /dev/fb0 -a img.jpg
Works for me, but no key control..
fbi -d /dev/fb0 photo.jpg
but I still get the error that you mention. I'm logged into the Pi via SSH from Kubuntu Linux's Konsole terminal emulator. Have you any ideas how to fix this? – dotancohen Aug 09 '13 at 15:47-d /dev/tty1
does not work either, but some googling revealed-T 1
(open via VT1) which is not documented in the man page :/ So try that (presuming it is the first VT that you see on the screen); I will edit something in above, and let me know here if it worked. – goldilocks Aug 09 '13 at 16:04-T 1
flag. Although using the command does in fact prevent thenot a linux console?
message, no image appears! Perusing theman
page does uncover: "fbi also needs access to the linux console (i.e. /dev/ttyN) for sane console switch handling. That is obviously no problem for console logins,but any kind of a pseudo tty (xterm, ssh, screen, ...) will not work." Even dropping out oftmux
didn't help. Do you say that you have managed to display images via SSH without X? – dotancohen Aug 11 '13 at 06:55