I have a problem when running a loop of vlc instances in python (using python bindings).
this is a sample code (open a file and convert it for 2 seconds in another file):
Code: Select all
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import vlc, time,os
itv=2 #intervalle in seconds
class one_player():
def __init__(self,cmd):
self.player = vlc.MediaControl(cmd)
self.cmd = cmd
idx=0
while True:
idx+=1
lineCmd = []
lineCmd.append("--volume=0")
lineCmd.append("--sout=#transcode{acodec=mp3,ab=64,channels=1}:" + \
"duplicate{dst=std{access=file,mux=raw,dst=/tmp/"+str(idx)+".mp3}}")
enreg= one_player(lineCmd)
enreg.player.set_mrl("/tmp/test.mp3")
enreg.player.start()
time.sleep(itv)
enreg.player.stop()
if not os.path.isfile("/tmp/"+str(idx)+".mp3"):
print "----------------------ERREUR-->"+str(idx)
Here is the error Message :
Code: Select all
[00001987] main interface error: interface thread could not be created at interface/interface.c:168 (Resource temporarily unavailable)
[00001987] main interface error: cannot spawn interface thread
[00001988] main interface error: interface thread could not be created at interface/interface.c:168 (Resource temporarily unavailable)
[00001988] main interface error: cannot spawn interface thread
[00001989] main input error: input thread could not be created at input/input.c:370 (Resource temporarily unavailable)
[00001989] main input error: cannot create input thread
----------------------ERREUR-->53
Code: Select all
[00001991] main interaction error: Interaction control thread could not be created at interface/interaction.c:382 (Resource temporarily unavailable)
[00001991] main interaction error: Interaction control thread creation failed, interaction will not be displayed
[00001995] main stream error: Out of memory when allocating stream cache (12582912 bytes)
[00001996] main preparser error: preparser thread could not be created at playlist/thread.c:79 (Resource temporarily unavailable)
[00001992] main playlist error: cannot spawn preparse thread
[00001997] main interface error: interface thread could not be created at interface/interface.c:168 (Resource temporarily unavailable)
[00001997] main interface error: cannot spawn interface thread
[00001998] main interface error: interface thread could not be created at interface/interface.c:168 (Resource temporarily unavailable)
[00001998] main interface error: cannot spawn interface thread
[00001999] main interface error: interface thread could not be created at interface/interface.c:168 (Resource temporarily unavailable)
[00001999] main interface error: cannot spawn interface thread
[00002000] main input error: input thread could not be created at input/input.c:370 (Resource temporarily unavailable)
[00002000] main input error: cannot create input thread
----------------------ERREUR-->54
Thanks for any idea ! (ubuntu 9.04 and VLC media player - version 0.9.9a Grishenko - given by the Python Binding)