Re: [Vnc2swf-users] [Error] unsupported operand type
Status: Alpha
Brought to you by:
euske
|
From: David K. <dav...@gm...> - 2008-04-30 20:10:19
|
I share all this, not as a final solution, but rather a "how to read
the error message" and only respond because no one else had anything for
you. I don't use pyvnc2swf, this is just general python/linux
troubleshooting.
It looks like self.sample_rate is not set, according to the error. The
first thing is to make sure that I am using it correctly, checking all
the command-line parameters, especially those related to MP3s.
I found all the parameters in edit.py:
usage: edit.py
[-d] [-c] [-t type] [-V] [-f|-F frames] [-a mp3file] [-r framerate]
[-S mp3sampleskip] [-C WxH+X+Y] [-B blocksize] [-K keyframe]
[-R framestep] [-s scaling]
-o outfile.swf file1 file2 ...
Specify one output filename from the following:
*.swf: generate a SWF movie.
*.flv: generate a FLV movie.
*.mpg: generate a MPEG movie.
*.png|*.bmp: save snapshots of given frames as "X-nnn.png"
-d: debug mode.
-c: compression.
-t {shape,video,mpeg,png,bmp}: specify the output movie type.
-V: equivalent to -t video. (Flash version7 or above only)
-f(-F) frames: frames to extract. e.g. 1-2,100-300,310,500-
-F disables seeking audio.
-R framestep: frame resampling step (default: 1)
-s scaling: scale factor (default: 1.0)
-a filename: attach MP3 file(s). (multiple files can be specified)
-r framerate: override framerate.
-B blocksize: (Video mode only) blocksize of video packet (must be a multiple of 16)
-K keyframe: keyframe interval
-S N[s]: skip the first N samples (or N seconds) of the sound when the movie starts.
-C WxH+X+Y: crop a specific area of the movie.
-b: disable seekbar.
-l: disable loop.
-z: make the movie scalable.
So, it seems like some important things are these:
[-a mp3file] [-S mp3sampleskip]
So, if those didn't solve the problem, I would move on to the code.
The error message is saying that on line 83, None and and integer are
being multiplied (which is not supported, in python None and 0 are
different types of things. NoneType is for things that are not defined)
On Ubuntu I did a search for mp3 related python modules (to see if there
might be a missing dependency) like this:
apt-cache search mp3|grep python
It came up with this list:
python-eyed3 - Python module for id3-tags manipulation
python-mutagen - audio metadata editing library
python-hachoir-metadata - Program to extract metadata using Hachoir library
python-id3 - Python module for id3-tags manipulation
python-kaa-metadata - Media Metadata for Python
python-mmpython - Media Metadata for Python
python-musicbrainz - Second generation incarnation of the CD Index - python bindings
python-osd - Python bindings for X On-Screen Display library
python-pykaraoke - free CDG/MIDI/MPEG karaoke player
python-pymad - Python wrapper to the MPEG Audio Decoder library
python-pynjb - python wrapper for libnjb
python-pysnmp-se - speed enhanced Python SNMP library for agents and managers
python-tagpy - Python module for manipulating tags in music files
python-tksnack - Sound functionality extension to Tcl/Tk and Python/Tkinter - Python library
python-tunepimp - Python bindings for MusicBrainz tagging library
Since the error appears to be related to getting info about the MP3s, or
creating the MP3s in the first place, you may want to try this on the
command-line (on Ubuntu):
sudo apt-get install python-eyed3 python-mmpython python-pymad python-tagpy python-id3 python-mmpython
Just to make sure all the stuff that works with MP3s is installed.
Again, I don't use pyvnc2swf, so this isn't related to actually
looking at it's dependencies, or some intimate knowledge
of pyvnc2swf, specifically, just a step I might take to get it
working quickly.
Also, if you are using linux, I might recommend using the C version at
http://www.unixuser.org/~euske/vnc2swf/
I use it on Ubuntu, with really great results. It's fast, and worked
right away for me. It says on the main page that it's not as actively
developed, or have as many features, but I really just want a fast,
low-overhead screencast maker, and it works perfectly for that.
On Wed, 2008-04-30 at 12:58 -0500, Lukasz Szybalski wrote:
> Any idea why I might be getting:
> > Traceback (most recent call last):
> > File "/home/lucas/pyvnc2swf/edit.py", line 244, in ?
> > if __name__ == "__main__": sys.exit(main(sys.argv[1:]))
> > File "/home/lucas/pyvnc2swf/edit.py", line 239, in main
> > mp3seek=mp3seek, mp3skip=mp3skip)
> > File "/home/lucas/pyvnc2swf/edit.py", line 86, in reorganize
> > builder.build(r)
> > File "/home/lucas/pyvnc2swf/output.py", line 999, in build
> > self.start()
> > File "/home/lucas/pyvnc2swf/output.py", line 941, in start
> > self.movie.info.mp3.seek_frame(0)
> > File "/home/lucas/pyvnc2swf/mp3.py", line 116, in seek_frame
> > needsamples = self.needsamples(t)
> > File "/home/lucas/pyvnc2swf/mp3.py", line 83, in needsamples
> > return int(self.sample_rate * t) + self.initial_skip
> > TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'
>
|