lapsule / python-mplayer

Automatically exported from code.google.com/p/python-mplayer
GNU Lesser General Public License v3.0
1 stars 0 forks source link

mplayer crashes #11

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. create a test.py:

from mplayer import Player, CmdPrefix

# Set default prefix for all Player instances
Player.cmd_prefix = CmdPrefix.PAUSING_KEEP

# Since autospawn is True by default, no need to call player.spawn() manually
player = Player()

# Play a file
player.loadfile('test.mov')

# Pause playback
player.pause()

# Get title from metadata
metadata = player.metadata or {}
print metadata.get('Title', '')

# Print the filename
print player.filename

# Seek +5 seconds
player.time_pos += 5

# Set to fullscreen
player.fullscreen = True

# Terminate MPlayer
player.quit()

What is the expected output? What do you see instead?

if I run from the command line

mplayer test.mov

it works

but if I run python test.py
it opens the file an instant and throws this error:
jjdenis@jj-linux:~/Programas$ python test.py 
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object 
file: No such file or directory
Unsupported PixelFormat 61
Unsupported PixelFormat 53
Unsupported PixelFormat 81

What version of the product are you using? On what operating system?
mplayer.py-0.7.0.tar.gz (md5)  on   Ubuntu 12.04 

Please provide any additional information below.
Thanks for your help.

Original issue reported on code.google.com by jjde...@gmail.com on 7 Oct 2012 at 5:48

GoogleCodeExporter commented 8 years ago
Hello, the errors you see in the command line are generated by MPlayer and are 
"harmless".

The code that you posted contains no blocking call (i.e. all method and 
function calls return immediately) that's why it reaches the last line, i.e. 
player.quit(), immediately thereby terminating MPlayer.

Refer to the test code in core.py:

    player = Player(sys.argv[1:], stderr=subprocess.PIPE)
    # block execution
    try:
        raw_input()
    except NameError: # raw_input() was renamed to input() in Python 3
        input()

Original comment by daru...@gmail.com on 16 Oct 2012 at 6:21

GoogleCodeExporter commented 8 years ago
It works!

Thank you very much!

El 16/10/2012, a las 08:21, python-mplayer@googlecode.com escribi�:

Original comment by jjde...@gmail.com on 22 Oct 2012 at 6:04