 |
|
| Computers Forum Index » Computer - Games Programming (Misc) » movieplayer |
|
Page 1 of 1 |
|
| Author |
Message |
| Serve Lau |
Posted: Thu Oct 25, 2007 10:37 pm |
|
|
|
Guest
|
What is relatively the easiest way to write a movie player? This is for an
embedded platform.
The movie does not have to be compressed as long as it can be streamed from
a flash card
Anyone have any ideas? |
|
|
| Back to top |
|
|
|
| Richard James |
Posted: Fri Oct 26, 2007 6:41 am |
|
|
|
Guest
|
Serve Lau wrote:
Quote: What is relatively the easiest way to write a movie player? This is for
an embedded platform.
The movie does not have to be compressed as long as it can be streamed
from a flash card
Anyone have any ideas?
Create a C Structure that has all the frame information in it
Make a loop and then read each frame into the structure then pass it to your
display function, not forgetting to pause.
I don't actually know what to do with sound. But I assume it is something
similar. Is the sound synced to the frame or is it a separate stream that
runs at a different rate?
Sound data synced to frames
+-------------+ +-------------+ +-------------+ +-------------+
| | | | | | | |
| Frame 1 | | Frame 2 | | Frame 3 | | Frame 4 |
| | | | | | | |
| | | | | | | |
| | | | | | | |
+-------------+ +-------------+ +-------------+ +-------------+
+-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+
|Snd 1| |Snd 2| |Snd 3| |Snd 4| |Snd 5| |Snd 6| |Snd 7| |Snd 8|
+-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+
Sound data not synced to frames
+-------------+ +-------------+ +-------------+ +-------------+
| | | | | | | |
| Frame 1 | | Frame 2 | | Frame 3 | | Frame 4 |
| | | | | | | |
| | | | | | | |
| | | | | | | |
+-------------+ +-------------+ +-------------+ +-------------+
+-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+
|Snd 1| |Snd 2| |Snd 3| |Snd 4| |Snd 5| |Snd 6| |Snd 7| |Snd 8|
+-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+
Richard James |
|
|
| Back to top |
|
|
|
| Serve Lau |
Posted: Fri Oct 26, 2007 11:17 pm |
|
|
|
Guest
|
"Richard James" <IWillGetOne@here> wrote in message
news:472145d3$0$20610$afc38c87@news.optusnet.com.au...
Quote: Serve Lau wrote:
What is relatively the easiest way to write a movie player? This is for
an embedded platform.
The movie does not have to be compressed as long as it can be streamed
from a flash card
Anyone have any ideas?
Create a C Structure that has all the frame information in it
Make a loop and then read each frame into the structure then pass it to
your
display function, not forgetting to pause.
Well yeah, making a movie player like that is easy, but I think I asked my
question wrong.
I mean a movie player which supports some well known format, so artists can
create lets say an avi out of a flash movie for instance. Im kinda hoping
that its possible to write a movie player that supports avi files where the
movie isnt compressed at all. |
|
|
| Back to top |
|
|
|
| Richard James |
Posted: Sat Oct 27, 2007 6:54 am |
|
|
|
Guest
|
Serve Lau wrote:
Quote: What is relatively the easiest way to write a movie player? This is for
an embedded platform.
The movie does not have to be compressed as long as it can be streamed
from a flash card
Well yeah, making a movie player like that is easy, but I think I asked my
question wrong.
I mean a movie player which supports some well known format, so artists
can create lets say an avi out of a flash movie for instance. Im kinda
hoping that its possible to write a movie player that supports avi files
where the movie isnt compressed at all.
Are you asking does AVI support uncompressed movies? The answer is yes. AVI
is a container format, it does not specify how movies are encoded.
see
http://en.wikipedia.org/wiki/Audio_Video_Interleave
As for writing such a player yourself, you are probably reinventing the
wheel. Most platforms and frameworks have players for AVI format videos or
mpeg ones. e.g. DirectX, SDL etc.
Richard James |
|
|
| Back to top |
|
|
|
| Luc The Perverse |
Posted: Sat Oct 27, 2007 6:54 am |
|
|
|
Guest
|
Serve Lau wrote:
Quote: "Richard James" <IWillGetOne@here> wrote in message
news:472145d3$0$20610$afc38c87@news.optusnet.com.au...
Serve Lau wrote:
What is relatively the easiest way to write a movie player? This is for
an embedded platform.
The movie does not have to be compressed as long as it can be streamed
from a flash card
Anyone have any ideas?
Create a C Structure that has all the frame information in it
Make a loop and then read each frame into the structure then pass it to
your
display function, not forgetting to pause.
Well yeah, making a movie player like that is easy, but I think I asked my
question wrong.
I mean a movie player which supports some well known format, so artists can
create lets say an avi out of a flash movie for instance. Im kinda hoping
that its possible to write a movie player that supports avi files where the
movie isnt compressed at all.
There are open source solutions which already exist to play virtually
all popular movie formats.
--
LTP
:) |
|
|
| Back to top |
|
|
|
| Serve Lau |
Posted: Wed Oct 31, 2007 7:41 pm |
|
|
|
Guest
|
"Luc The Perverse" <ataylor_no_spa_am@_letterC_solutions.n3t> wrote in
message news:m4jav4-3bb.ln1@loki.cmears.id.au...
Quote: Serve Lau wrote:
"Richard James" <IWillGetOne@here> wrote in message
news:472145d3$0$20610$afc38c87@news.optusnet.com.au...
Serve Lau wrote:
What is relatively the easiest way to write a movie player? This is
for
an embedded platform.
The movie does not have to be compressed as long as it can be streamed
from a flash card
Anyone have any ideas?
Create a C Structure that has all the frame information in it
Make a loop and then read each frame into the structure then pass it to
your
display function, not forgetting to pause.
Well yeah, making a movie player like that is easy, but I think I asked
my question wrong.
I mean a movie player which supports some well known format, so artists
can create lets say an avi out of a flash movie for instance. Im kinda
hoping that its possible to write a movie player that supports avi files
where the movie isnt compressed at all.
There are open source solutions which already exist to play virtually all
popular movie formats.
i can only find some which only run on mac, windows or linux. Arent there
any platform independant ones written in C? |
|
|
| Back to top |
|
|
|
| Anton |
Posted: Thu Nov 01, 2007 9:43 am |
|
|
|
Guest
|
Serve Lau
Quote:
i can only find some which only run on mac, windows or linux. Arent
there any platform independant ones written in C?
I doubt such thing as hardware accelerated (-aided) graphics can be
completely platform-independent. You might have a look at SDL... |
|
|
| Back to top |
|
|
|
| Nathan Mates |
Posted: Thu Nov 01, 2007 11:54 am |
|
|
|
Guest
|
In article <fga8t5$v43$1@news4.zwoll1.ov.home.nl>, Serve Lau <aser@n.tk> wrote:
Quote: There are open source solutions which already exist to play virtually all
popular movie formats.
i can only find some which only run on mac, windows or linux. Arent there
any platform independant ones written in C?
Nope. Your question reveals a deep misunderstanding of the C
language. There is *NO* built-in support for graphics, sound, or any
other sort of multimedia in the C/C++ programming language. [Well,
ascii art might be doable, but that usually needs help, too.] Under
C/C++, all sorts of multimedia are done not by the language itself,
but by addon libraries -- e.g. DirectX on Windows, OpenGL on other
platforms, etc. The core language is deliberately minimalist in what
it supports, which is one of the major reasons why C/C++ have taken
off.
Bottom line: you're going to need some 3rd party code to talk to
any sort of framebuffer. If you're using Windows, Mac, or Linux, this
has been done. If you're using a more obscure platform, you'll need to
write your own -- especially because you're more limited in CPU and
RAM than the 'big 3'. You can look at animated GIFs as a possible
starting point, but it's likely to be a lot of work from here.
Nathan Mates
--
<*> Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
# think. What are the facts, and to how many decimal places?" -R.A. Heinlein |
|
|
| Back to top |
|
|
|
| Serve Lau |
Posted: Sat Nov 03, 2007 1:36 am |
|
|
|
Guest
|
"Nathan Mates" <nathan@visi.com> wrote in message
news:13iiu18k68ict39@corp.supernews.com...
Quote: In article <fga8t5$v43$1@news4.zwoll1.ov.home.nl>, Serve Lau <aser@n.tk
wrote:
There are open source solutions which already exist to play virtually
all
popular movie formats.
i can only find some which only run on mac, windows or linux. Arent there
any platform independant ones written in C?
Nope. Your question reveals a deep misunderstanding of the C
language. There is *NO* built-in support for graphics, sound, or any
other sort of multimedia in the C/C++ programming language.
I know that, but I do think its possible to do it platform independant, just
the display code will have to be different over platforms. Why cant you ask
for a get_next_frame() and get a void * or char * back with the size
information etc that you can use to display the frame.
I made a movie player like that you have a directory full with bitmaps named
1.bmp, 2.bmp and you just loop over them with
for(i = 0; i < x; i++) { load_bitmap(i); plot_bitmap(i, x, y);
destroy_bitmap(i); }
very platform independant, only the actual plotting is platform dependant :)
this looks nice for small images, even on 40mhz processor, but breaks down
on 1024x768 images of course.
Thats why I'm looking for a library or something before trying to write this
myself. If there isnt one, maybe here's a good way to make some money lol |
|
|
| Back to top |
|
|
|
| Nathan Mates |
Posted: Sun Nov 04, 2007 5:57 am |
|
|
|
Guest
|
In article <fgg1nf$rj7$1@news3.zwoll1.ov.home.nl>, Serve Lau <aser@n.tk> wrote:
Quote: I know that, but I do think its possible to do it platform
independant, just the display code will have to be different over
platforms. Why cant you ask for a get_next_frame() and get a void *
or char * back with the size information etc that you can use to
display the frame.
Sorry, but this sounds like you happen to have a solution that
worked for you, and think it'll apply to everyone. There's just too
much variety of hardware for this to be meaningful. Consider pixel
formats: some systems only push 8 bit color. Some are 16 bit, in 4444,
5550, 5551, or 5650. 24/32 bit have RGB vs BGR ordering issues. Then
there's alignment and other issues. You can try to sweep these
differences under the rug, and say it's up to the display code to
reformat the color information, but that's going to have severe
performance problems on slower systems, compared to doing that in the
middle of your decode. You're going to thrash your cache if you have
to flip BGR to RGB as a second pass on a decompression buffer.
To decompress things *well* and *efficiently*, you need to know how
the hardware (or graphics API) expects the data. And that's why C/C++
properly say just about zero when it comes to multimedia. The
implementation details are just so significant that they need to be
considered. And therefore, multimedia shouldn't be part of the
programming language, but code to make multimedia happen can be
written in that language.
Nathan Mates
--
<*> Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
# think. What are the facts, and to how many decimal places?" -R.A. Heinlein |
|
|
| Back to top |
|
|
|
| Serve Lau |
Posted: Mon Nov 05, 2007 2:35 am |
|
|
|
Guest
|
"Nathan Mates" <nathan@visi.com> wrote in message
news:13iq68dhm7a7qc6@corp.supernews.com...
Quote: In article <fgg1nf$rj7$1@news3.zwoll1.ov.home.nl>, Serve Lau <aser@n.tk
wrote:
I know that, but I do think its possible to do it platform
independant, just the display code will have to be different over
platforms. Why cant you ask for a get_next_frame() and get a void *
or char * back with the size information etc that you can use to
display the frame.
Sorry, but this sounds like you happen to have a solution that
worked for you, and think it'll apply to everyone.
yeah true, the advantage of systems like this is that you can just write to
one particular hardware configuration which will always be the same. Guess
I'll write own then. |
|
|
| Back to top |
|
|
|
| Michel de Brisis |
Posted: Tue Feb 19, 2008 8:01 pm |
|
|
|
Guest
|
Serve Lau wrote:
Quote: "Luc The Perverse" <ataylor_no_spa_am@_letterC_solutions.n3t> wrote in
message news:m4jav4-3bb.ln1@loki.cmears.id.au...
Serve Lau wrote:
"Richard James" <IWillGetOne@here> wrote in message
news:472145d3$0$20610$afc38c87@news.optusnet.com.au...
Serve Lau wrote:
What is relatively the easiest way to write a movie player? This is
for
an embedded platform.
The movie does not have to be compressed as long as it can be streamed
from a flash card
Anyone have any ideas?
Create a C Structure that has all the frame information in it
Make a loop and then read each frame into the structure then pass it to
your
display function, not forgetting to pause.
Well yeah, making a movie player like that is easy, but I think I asked
my question wrong.
I mean a movie player which supports some well known format, so artists
can create lets say an avi out of a flash movie for instance. Im kinda
hoping that its possible to write a movie player that supports avi files
where the movie isnt compressed at all.
There are open source solutions which already exist to play virtually all
popular movie formats.
i can only find some which only run on mac, windows or linux. Arent there
any platform independant ones written in C?
Doesn't VLC (found at www.videolan.org) fit all the criteria here?
*Open source
*Platform independent |
|
|
| Back to top |
|
|
|
| IsaacKuo |
Posted: Fri Apr 04, 2008 7:09 pm |
|
|
|
Guest
|
On Feb 19, 9:01 am, Michel de Brisis <michel.bri...@gmail.com> wrote:
Quote: Serve Lau wrote:
What is relatively the easiest way to write a movie player? This is
for
an embedded platform.
The movie does not have to be compressed as long as it can be streamed
from a flash card
i can only find some which only run on mac, windows or linux. Arent there
any platform independant ones written in C?
Doesn't VLC (found atwww.videolan.org) fit all the criteria here?
*Open source
*Platform independent
I think he means "platform independent" as in not needing
any platform at all (no OS). I have no idea if VLC would
be useful for him. Maybe. Another option might be
mplayer, which I know has been stuffed into really tight
spaces; for example geexbox:
http://www.geexbox.org/en/index.html
Isaac Kuo |
|
|
| Back to top |
|
|
|
|
|
All times are GMT
The time now is Sat Mar 20, 2010 10:22 am
|
|