Link to home
Start Free TrialLog in
Avatar of riceman0
riceman0

asked on

How to create an embedded video player


Hello, I've got an at91sam9261 up and running, and it is working (more or less) with an LCD (640x480), and I can draw pixels and pictures to it just fine.  (Currently we are not using an OS, just writing C code off a main loop.)

But we're thinking about what it would take to play video.  Say I started with a small file of AVI, MPG, WMV format, what do I need to do to play this on the LCD.  

I assume we have all the hardware we need -- control of an LCD and a fairly powerful processor.  But what do I need in terms of software?  Words like "codec" come to mind... are these commercially available, can we write one, are there open source C libraries?  I assume this is a fairly solved problem.

Anyway, any insight from someone who's at least thought through playing videos on embedded would be very helpful.  Thanks.

Avatar of HappyCactus
HappyCactus
Flag of Italy image

The simplest solution is to have an embedded linux distribution available on the board with an open source media player.
Atmel Sistem On Chip are well supported in linux - both with glibc and uclibc libraries.
Writing a media player even to provide support only for one kind of file is a very difficult task, and probably would require some feature that an operating system would support (a scheduler?).
So I suggest you to take an embedded linux distribution and start experiment with it.
If your board manufacturer have a linux distribution ready, start with it.
Otherwise, try build your own - it's not an easy task, but it's easier than writing a player.
I currently use buildroot (buildroot.uclibc.org) but there are many other and it's a very small footprint.

Hope that helps.
Avatar of riceman0
riceman0

ASKER


Thanks, it would be logical to bring in an OS at this point.  But say I didn't want to do that, seems like I shouldn't have to take on an entire OS in order to decode data of a well-known format.  Is there is no magic C library, I am supposing the function:

void play_avi_data(char * from_avi_data, char * to_display_buffer, unsigned int width, unsigned int height)

or maybe

void draw_avi_frame(char * from_avi_data, char * to_display_buffer, unsigned int width, unsigned int height, unsigned long frame_number)

which you call at the desired frame rate.  This seems like it is complex but eminently doable, and whoever has written this function would sell it.

What is it that makes it not this simple?

ASKER CERTIFIED SOLUTION
Avatar of HappyCactus
HappyCactus
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial