tahi
Posts: 9
Joined: Thu Aug 21, 2014 9:10 am

Video stream app

Thu Aug 21, 2014 9:33 am

Hello everyone,

I have a project in home.
- I want to store many pictures bmp in SD card. I need merge them to video file
My question:
- What's exactly software do i need develop?
(linux gui application, shell, linux driver like hdmi or sd card? or...
I'm very confusing..

So, any expert give me the idea about project structure and relative knowledge
Thank you so much!

Tahi
Last edited by tahi on Wed Sep 03, 2014 11:03 am, edited 1 time in total.

fruitoftheloom
Posts: 23132
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Display bmp or jpeg like video stream

Thu Aug 21, 2014 11:50 am

Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

gkreidl
Posts: 6307
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Display bmp or jpeg like video stream

Thu Aug 21, 2014 2:07 pm

perhaps 1 image /second
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

tahi
Posts: 9
Joined: Thu Aug 21, 2014 9:10 am

Re: Display bmp or jpeg like video stream

Thu Aug 21, 2014 4:39 pm

Assume that, our program flow seems as:
- Turn on Raspberry
- Wait start signal from one GPIO.
- Display full-screen picture via HDMI with fix rate (30 picture / second)
So what will we do? What are risks in this project ?

gkreidl
Posts: 6307
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Display bmp or jpeg like video stream

Thu Aug 21, 2014 5:33 pm

tahi wrote:Assume that, our program flow seems as:
- Turn on Raspberry
- Wait start signal from one GPIO.
- Display full-screen picture via HDMI with fix rate (30 picture / second)
So what will we do? What are risks in this project ?
It won't be possible (30/sec).
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

KenT
Posts: 758
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
Contact: Website

Re: Display bmp or jpeg like video stream

Thu Aug 21, 2014 5:44 pm

I've seen somebody do it but I cannot find the link, it involved lua so could be info-beamer. I believe you need to use the gpu and preload all the images to the gpu. [edit] even this may not achieve 30fps

easiest way is to make the images into a mp4 video offline. Then use one shot mediashow in Pi Presents ;-)
Last edited by KenT on Thu Aug 21, 2014 5:50 pm, edited 1 time in total.
Pi Presents - A toolkit to produce multi-media interactive display applications for museums, visitor centres, and more
Download from http://pipresents.wordpress.com

User avatar
rpdom
Posts: 17029
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Display bmp or jpeg like video stream

Thu Aug 21, 2014 5:48 pm

Generate video from the sources frame images. (possibly on a faster machine).

Playback using omxplayer.

User avatar
Cancelor
Posts: 775
Joined: Wed Aug 28, 2013 4:09 pm
Location: UK

Re: Display bmp or jpeg like video stream

Thu Aug 21, 2014 9:04 pm

tahi wrote:Assume that, our program flow seems as:
- Turn on Raspberry
- Wait start signal from one GPIO.
- Display full-screen picture via HDMI with fix rate (30 picture / second)
So what will we do? What are risks in this project ?
I'm not totally clear what you want to do ...... You want to display one BMP picture at a time? How long do you want to display it for?
Can't find the thread you want? Try googling : YourSearchHere site:raspberrypi.org

tahi
Posts: 9
Joined: Thu Aug 21, 2014 9:10 am

Re: Display bmp or jpeg like video stream

Fri Aug 22, 2014 1:14 am

Thank for all,

Actually, my rasp connect to projector via hdmi. I want control the pictures which are displayed by projector.
(These pictures are like stop motion animation. But they are not video format)

As, you can imagine:
- You hold the next key when you show slide(in my case: it's bmp or jpg file for one slide) by MS powerpoint.

You suggested me some method to make video from image. But, i't hard to control the rate. Display rate may changed in process.
Finally, I want to emphasize a question:
"Primary target of my project is: i must create GUI application for Raspberry Pi or not? Anything else i need to concern?"

Sincerely,
Tahi

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Display bmp or jpeg like video stream

Fri Aug 22, 2014 6:36 am

You need to be aware that the Pi is not as fast as todays
desktop computers , even things like decoding and rescaling
pictures take time on the CPU. If you were to use the GPU ,
you can accelerate the process. As others have told you ,
it would be difficult to display more than one picture per
second (without HW acceperation i guess).

And no , your software does not need to use a GUI :
fbi works on the console , and you could write a similiar
application (propably with hardware acceleration).

Look here for further inspiration : http://www.raspberrypi.org/forums/viewt ... 67&t=80982

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

fruitoftheloom
Posts: 23132
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Display bmp or jpeg like video stream

Fri Aug 22, 2014 7:43 am

ghans wrote:And no , your software does not need to use a GUI :
fbi works on the console , and you could write a similiar
application (propably with hardware acceleration).
My first response http://www.queryadmin.com/435/create-im ... spberry-pi uses fbi what a co-incidence ??

Man fbi http://manpages.ubuntu.com/manpages/gut ... fbi.1.html
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Display bmp or jpeg like video stream

Fri Aug 22, 2014 8:05 am

It seems faster , but i don't know if a 30fps slideshow is
even possible on a Linux PC. The sane thing to do is
definetely to encode the pictures into a video file (which would
also work on a Pi without problems , as long its
encoded in h.264).

ghwns
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

tahi
Posts: 9
Joined: Thu Aug 21, 2014 9:10 am

Re: Display bmp or jpeg like video stream

Fri Aug 22, 2014 8:30 am

ghans wrote:It seems faster , but i don't know if a 30fps slideshow is
even possible on a Linux PC. The sane thing to do is
definitely to encode the pictures into a video file (which would
also work on a Pi without problems , as long its
encoded in h.264).

ghwns
Thank you ghans.
In fact, if Rasp hardware resource is not suitable. I can order more powerful board. May be I should start project with easier requirement.
- 2 frame/second
Encode the pictures into video file will takes longer time to do by CPU. Morever, it's hard to change speed when streaming process (Eg: Begin, your board display 10 frame/sec, after that display rate is 5 fram/sec?)

Do you know the C library or toolkit which is supported this task?

Br,
Tahi

gkreidl
Posts: 6307
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Display bmp or jpeg like video stream

Fri Aug 22, 2014 8:31 am

I don't think you really analyzed the problems of your project yet.

If you use uncompressed bmp files, a full HD RGB image will be about 6 MByte. Disk access will be the bottle neck then. You won't be able to load more than 4 or 5 images / sec.

If you use JPEG and compress them down to about 500 KB, loading 30 images / sec. might be possible. But now the time to decode an image will be the bottleneck. The only solution may be to use the GPU for it (even on much faster machines than the RPi). You have to study mmal or openmax for a solution. Ghans gave you a link to small c++ program that uses the GPU for image decoding. That might be a starting point.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

tahi
Posts: 9
Joined: Thu Aug 21, 2014 9:10 am

Re: Display bmp or jpeg like video stream

Fri Aug 22, 2014 9:23 am

gkreidl wrote:I don't think you really analyzed the problems of your project yet.

If you use uncompressed bmp files, a full HD RGB image will be about 6 MByte. Disk access will be the bottle neck then. You won't be able to load more than 4 or 5 images / sec.

If you use JPEG and compress them down to about 500 KB, loading 30 images / sec. might be possible. But now the time to decode an image will be the bottleneck. The only solution may be to use the GPU for it (even on much faster machines than the RPi). You have to study mmal or openmax for a solution. Ghans gave you a link to small c++ program that uses the GPU for image decoding. That might be a starting point.
Please forgive me. I am (such) an idiot. Recent day, i read many thing about linux os, porting, write kernel driver, cross-compiler...so on.. Many knowledge to study. I try to analyze my problem with my experience. I knew, it's so bad. But, Everyone can see and help me find out the way to resolve my problem.

Thank you again,

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Display bmp or jpeg like video stream

Fri Aug 22, 2014 11:21 am

The general idea is to encode the slideshow into
a video ahead of time , some time before you actually
need it. Then it shouldn't make a difference if this process
takes hours or a few dozen minutes. How you do this is
up to you.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

tahi
Posts: 9
Joined: Thu Aug 21, 2014 9:10 am

Re: Display bmp or jpeg like video stream

Mon Aug 25, 2014 2:52 am

I reviewed again my project requirement. I realize that:
- CPU have ten seconds to turn on and off the monitor and display one picture.
That mean, i just load all picture data content to GPU ram in 1 time.
May be, this point makes my project is possible to do.

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Display bmp or jpeg like video stream

Mon Aug 25, 2014 6:35 am

Note that this approach still needs time to actually read the files into RAM , because no SD card can achieve
150 MB/s needed for 30 fps uncompressed HD on the Pi. Furthermore , you can only preload 3 seconds on a model B this way.
I still do not understand your insistence to use picture files for moving film. Using h.264 video would solve all your problems in an instant.

I guess if you keep to this restriction , you will find that the Pi is the wrong platform for you , and fork out several
hundred dollars for special equipment.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

tahi
Posts: 9
Joined: Thu Aug 21, 2014 9:10 am

Re: Display bmp or jpeg like video stream

Mon Aug 25, 2014 7:26 am

Hi Ghans

Picture is mask. Properties of material is changed when it's projected by light source from projector. It's look like etching PCB process.

Sincerely,
Tahi

pksato
Posts: 295
Joined: Fri Aug 03, 2012 5:25 pm
Location: Brazil

Re: Display bmp or jpeg like video stream

Mon Aug 25, 2014 12:32 pm

Hi,
mplayer (not omxplayer) can be used to play image files (jpg, png, bmp, etc) like a video.
mplayer mf://*.jpg -mf fps=30 -vf scale=1024 -fs
display all jpg files on current directory, play at 30fps and scale to 1024px width (to match with monitor/tv) and put on fullscreen.
Can use a file with a list of image files.
mplayer mf://@filelist -mf fps=30 -vf scale=1024 -fs

Or, for finished video, GPU can be used to encode on h264.

(not tested on raspberry pi)

tahi
Posts: 9
Joined: Thu Aug 21, 2014 9:10 am

Re: Display bmp or jpeg like video stream

Tue Aug 26, 2014 2:28 am

pksato wrote:Hi,
mplayer (not omxplayer) can be used to play image files (jpg, png, bmp, etc) like a video.
mplayer mf://*.jpg -mf fps=30 -vf scale=1024 -fs
display all jpg files on current directory, play at 30fps and scale to 1024px width (to match with monitor/tv) and put on fullscreen.
Can use a file with a list of image files.
mplayer mf://@filelist -mf fps=30 -vf scale=1024 -fs

Or, for finished video, GPU can be used to encode on h264.

(not tested on raspberry pi)
I tried...But i did not see any picture on screen.
On terminal:
Playing slice_0001.jpg
Playing slice_0001.jpg
Playing slice_0001.jpg
....
Playing slice_0500.jpg
Exiting ... (End of file)

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: Display bmp or jpeg like video stream

Tue Aug 26, 2014 10:50 pm

It's still not clear what you're wanting to do (i.e. why it has to be images instead of a video), but perhaps http://www.raspberrypi.org/bioscope-old ... ur-movies/ is along the lines you're after?

tahi
Posts: 9
Joined: Thu Aug 21, 2014 9:10 am

Re: Display bmp or jpeg like video stream

Thu Aug 28, 2014 2:38 am

AndrewS wrote:It's still not clear what you're wanting to do (i.e. why it has to be images instead of a video), but perhaps http://www.raspberrypi.org/bioscope-old ... ur-movies/ is along the lines you're after?
Because source file is bmp file. It will take more time for converting from bmp to video format.
For instance:
- I have 2 pictures: file1.bmp, file2.bmp
My system:
sdcard (store 2 picture) -> rasberry pi ---- (hdmi) ---> projector
step 1: display file1.bmp by projector in few second
step 2: continue with file2.bmp
...
In my opinion, i intend to:
- Read first picture, put data content of 1 picture to GPU RAM
- Control display rate by GPU.
- Free memory in GPU RAM
- Continues put another picture..

Sincerely,
Tahi

Return to “Beginners”