473,396 Members | 1,940 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
7 7490
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: AnsNum | last post by:
hello, when I start this program, the movie doesn't play smoothly, anybody has an idea ? (I use windowsXP) import pygame from pygame.display import flip from pygame.locals import * ...
2
by: Lane LiaBraaten | last post by:
Does anyone know a way to insert a pygame surface into a tkinter gui? I am writing a program similar to a mpeg player, i.e. i need the mpeg playing capabilities of pygame and the gui stuff from...
16
by: BOOGIEMAN | last post by:
Beginners question, but really what can you do with it ? How hard is Python to learn compared with other languages (let's say C#). Can you make fullscreen game with it (for example) ? I've looked...
3
by: Tim Knauf | last post by:
Hi everyone, I'm glad to have found this list. I've written a small script for my own use which, amongst other things, captures mouse click information from a window containing an image. I used...
1
by: liuliuliu | last post by:
hi -- sorry if this is trivial -- but how do you make a screenshot of a pygame display? i have a surface which is basically the entire visible screen -- how do you write this surface as an image...
0
by: Volkan Senguel | last post by:
Hi, im trying to create a Flash Movie with a embedded MPEG Movie inside like this ones at youtube.com. But i have not found any tips on the internet...(!?) My Goal is to define a Flash (.swf)...
8
Death Slaught
by: Death Slaught | last post by:
The title is the question. what would be the best way to embed a video that was made in windows movie maker ive tried different formats .swf .avi .mpeg and ive tried embeding it, making it a link,...
4
kaarthikeyapreyan
by: kaarthikeyapreyan | last post by:
I have installed pygame v 1.8.0 The installation was sucessful, but the optional packages were not included like the font,movie etc When i was trying to run the sample script that was given it...
11
by: globalrev | last post by:
http://www.pygame.org/docs/ref/mixer.html import pygame #pygame.mixer.init(frequency=22050, size=-16, channels=2, buffer=3072) //it complained abiout words= so i guess its only the nbrs...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.