By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,199 Members | 1,458 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,199 IT Pros & Developers. It's quick & easy.

What does pygame.Movie mean by `an MPEG file'?

P: n/a
I just found this amazing video puzzle game written with the pygame
library, which promises to be infinite fun - but I can't get it to
decode any video file I own, except the game's own example .mpg. All I
have is lots and lots of useless .avi, .mp2, .wmv, and so on...

Now, the pygame.Movie documentation says the Movie class can decode
`MPEG movie files'. I know little about multimedia, but I thought
divx/xvid video was a variant of MPEG4, and mp3 audio a variant of
MPEG1 Layer 3. So obviously, `MPEG movie files' means something more
specific than just `contains MPEG streams'. Does anyone know what
precisely it means? Even better, how should I instruct transcode or
similar programs to re-encode existing files so that Movie objhects
can be created from them?

--
No animal was harmed in the composition of this message.

Sep 28 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
An MPEG is a type of video file, you are correct in that assumption.
Things such as DivX and Xvid are called codec's
(COmpressor/DECompressor) codec's are used to conserve disk space, raw
video files are very large.

It is quite likely that PyGame does not support the compression being
used by your videos. For more information on multimedia files and
codecs, check out:

http://www.videohelp.com/

As for the types of compression (if any) that PyGame supports, I'll
have to look into that.

Sep 28 '05 #2

P: n/a
Kilian A. Foth a écrit :
I just found this amazing video puzzle game written with the pygame
library, which promises to be infinite fun - but I can't get it to
decode any video file I own, except the game's own example .mpg. All I
have is lots and lots of useless .avi, .mp2, .wmv, and so on...

Now, the pygame.Movie documentation says the Movie class can decode
`MPEG movie files'. I know little about multimedia, but I thought
divx/xvid video was a variant of MPEG4, and mp3 audio a variant of
MPEG1 Layer 3. So obviously, `MPEG movie files' means something more
specific than just `contains MPEG streams'. Does anyone know what
precisely it means? Even better, how should I instruct transcode or
similar programs to re-encode existing files so that Movie objhects
can be created from them?


An mpeg file is a file with the .mpg or .mpeg extension. IIRC, it's a
raw mpeg 1 or 2 stream dumped in a file. Not sure about the raw stream
but I'm sure it can only be mpeg 1 or 2.
Sep 28 '05 #3

P: n/a
Christophe wrote:
Kilian A. Foth a écrit :
I just found this amazing video puzzle game written with the pygame
library, which promises to be infinite fun - but I can't get it to
decode any video file I own, except the game's own example .mpg. All I
have is lots and lots of useless .avi, .mp2, .wmv, and so on...

Now, the pygame.Movie documentation says the Movie class can decode
`MPEG movie files'. I know little about multimedia, but I thought
divx/xvid video was a variant of MPEG4, and mp3 audio a variant of
MPEG1 Layer 3. So obviously, `MPEG movie files' means something more
specific than just `contains MPEG streams'. Does anyone know what
precisely it means? Even better, how should I instruct transcode or
similar programs to re-encode existing files so that Movie objhects
can be created from them?

An mpeg file is a file with the .mpg or .mpeg extension. IIRC, it's a
raw mpeg 1 or 2 stream dumped in a file. Not sure about the raw stream
but I'm sure it can only be mpeg 1 or 2.


I doubt that it is a raw stream dump, since it would have to contain an
audio and a video stream ?
There is probably an mpeg container format, such as ogg is only a
container for vorbis or theora streams.
Sep 28 '05 #4

P: n/a
On 2005-09-28, Kilian A. Foth <fo**@informatik.uni-hamburg.de> wrote:
I just found this amazing video puzzle game written with the pygame
library, which promises to be infinite fun - but I can't get it to
decode any video file I own, except the game's own example .mpg. All I
have is lots and lots of useless .avi, .mp2, .wmv, and so on...
There are two issues when it comes to video files:

1) The "container" format. That defines the mechanism used to
combine the video and audio data streams into a single byte
stream (e.g. a file). This is what is usually denoted by
file file suffix. Mpeg, wmv, avi are all container file
formats.

2) The "Codec" (coder/decoder) used to encode the information
_within_ the audo or video stream. mpeg4, mpeg2, divx are
all video codecs mp3, ac3, flac, ogg are audio codecs.

You can mix and match pretty much any container format with any
video codec and and any audio codec.
Now, the pygame.Movie documentation says the Movie class can decode
`MPEG movie files'.
That probably means it understands the mpeg container file
format and the mpeg1 or mpeg2 video codec format. It might
support the mpeg4 codec as well, but I'd guess mpeg2 is the
most likely.
I know little about multimedia, but I thought divx/xvid video
was a variant of MPEG4, and mp3 audio a variant of MPEG1 Layer
3. So obviously,
Yes. But those are codecs. If the streams aren't in a
recognized container, it doesn't matter what codec was used.
Or, the app may not understand DivX/mpeg4 and may only support
mpeg1/2.
`MPEG movie files' means something more specific than just
`contains MPEG streams'. Does anyone know what precisely it
means?
It doesn't really mean anything precisely. In order to be
precise, you have to specify the container format and which
codecs are supported.
Even better, how should I instruct transcode or similar
programs to re-encode existing files so that Movie objhects
can be created from them?


I use mencoder (part of mplayer)

http://www.mplayerhq.hu/homepage/design7/news.html

or tanscode.

http://freshmeat.net/projects/transcode/

I'd try mpeg container with mpeg2 video.

--
Grant Edwards grante Yow! Let's climb to the
at TOP of that MOUNTAIN and
visi.com think about STRIP MINING!!
Sep 28 '05 #5

P: n/a
Grant Edwards schreef:
There are two issues when it comes to video files:

1) The "container" format. That defines the mechanism used to
combine the video and audio data streams into a single byte
stream (e.g. a file). This is what is usually denoted by
file file suffix. Mpeg, wmv, avi are all container file
formats.

2) The "Codec" (coder/decoder) used to encode the information
_within_ the audo or video stream. mpeg4, mpeg2, divx are
all video codecs mp3, ac3, flac, ogg are audio codecs.


Nitpick: ogg is not an audio codec, but the container format of
xiph.org. The lossy audio codec used in the project is called vorbis.
Besides vorbis and flac there's also speex, designed for speech data.
--
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton

Roel Schroeven
Sep 28 '05 #6

P: n/a
On 2005-09-28, Roel Schroeven <rs****************@fastmail.fm> wrote:
Grant Edwards schreef:
There are two issues when it comes to video files:

1) The "container" format. That defines the mechanism used to
combine the video and audio data streams into a single byte
stream (e.g. a file). This is what is usually denoted by
file file suffix. Mpeg, wmv, avi are all container file
formats.

2) The "Codec" (coder/decoder) used to encode the information
_within_ the audo or video stream. mpeg4, mpeg2, divx are
all video codecs mp3, ac3, flac, ogg are audio codecs.


Nitpick: ogg is not an audio codec, but the container format of
xiph.org. The lossy audio codec used in the project is called vorbis.
Besides vorbis and flac there's also speex, designed for speech data.


Ah, thanks for the correction. I had always thought that
"ogg/vorbis" was the name of the codec, and it should have
occured to me that ogg was the container format.

--
Grant Edwards grante Yow! Hmmm... A hash-singer
at and a cross-eyed guy were
visi.com SLEEPING on a deserted
island, when...
Sep 28 '05 #7

P: n/a
Christophe <ch*************@free.fr> wrote:
Kilian A. Foth a écrit :
I just found this amazing video puzzle game written with the pygame
library, which promises to be infinite fun - but I can't get it to
decode any video file I own, except the game's own example .mpg. All I
have is lots and lots of useless .avi, .mp2, .wmv, and so on...

Now, the pygame.Movie documentation says the Movie class can decode
`MPEG movie files'. I know little about multimedia, but I thought
divx/xvid video was a variant of MPEG4, and mp3 audio a variant of
MPEG1 Layer 3. So obviously, `MPEG movie files' means something more
specific than just `contains MPEG streams'. Does anyone know what
precisely it means? Even better, how should I instruct transcode or
similar programs to re-encode existing files so that Movie objhects
can be created from them?
An mpeg file is a file with the .mpg or .mpeg extension. IIRC, it's a
raw mpeg 1 or 2 stream dumped in a file. Not sure about the raw stream
but I'm sure it can only be mpeg 1 or 2.


Alright, several tries later I now know the pygame accepts only MPEG
program stream containers, with MPEG1 video and MPEG2 audio. I found
that the command

mencoder -of mpeg -ovc lavc -oac lavc \
-lavcopts acodec=mp2:vcodec=mpeg1video:vbitrate=5000 -o new.mpg old.avi

successfully creates such files. I'm off to play video puzzle now!
--
No animal was harmed in the composition of this message.

Sep 29 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.