Hi,
due to some requests from the animation department i ve spent a lot of time trying to install and test some linux videoplayers like vlc, openshot, djv, smplayer, banshee, etc.
I’ve come to the conclusion that only the “melt” video engine meets all the requirements. But there is a downside: it has no GUI!!
we have to launch the video player like this: “melt <video1> <video2>” by typing this on the gnome-terminal
Ive made a maya GUI with python and pyside and my only concern now is launching the melt video player by pressing a GUI button.
But this fails to work with melt… gosh but why does it not work if it works through the gnome terminal!![/QUOTE]
Hi,
For the Popen grammar, this works for me :
save = subprocess.Popen([B][[/B]self.pathToAfter, "-r", self.JSX['save'][B]][/B])
save.communicate()# use this to wait for your subprocess to complete before continuing the rest of your script
My self.pathToAfter is an absolute path to my executable as Theodox suggested.
Hope this helps !
This opens a terminal and apparently runs the command but gives me the following error:
mlt_repository_init: failed to dlopen /usr/lib64/mlt/libmltavformat.so
(/lib64/libavfilter.so.4: symbol sws_isSupportedEndiannessConversion, version LIBSWSCALE_2 not defined in file libswscale.so.2 with link time reference)
No LADSPA plugins were found!
Check your LADSPA_PATH environment variable.
bash: line 1: 12447 Segmentation fault (core dumped) /usr/local/bin/melt /home/rigging/Desktop/pelota.mov
I don’t understand why if i run it manually from the terminal it opens a window and plays the video and conversely if i launch from python i get that error…
Try copying your current os.environ (os.environ.copy) and pass that to your subprocess call with the env argument. Seems like your python interpreter is launching the subprocess with a different set of environment variables than your OS and thus it’s failing to launch.
Try copying your current os.environ (os.environ.copy) and pass that to your subprocess call with the env argument. Seems like your python interpreter is launching the subprocess with a different set of environment variables than your OS and thus it’s failing to launch.[/QUOTE]
Hi Sonictk, that sounded like the correct answer and i tried it but still no change.
I’ve tested in another machine that didn’t have openshot previously installed (it relies on melt-0.9.0 under the hood) and i have discovered that my install of melt-0.9.2 was lacking some packages that were provided by the openshot installation so my guess is melt is playing the videos through the command line (once openshot installed) by luck because I hadn’t provided the right packages first.
Still without an answer about why it works on the terminal and why i get the error with subprocess.call with env=os.environ.copy() set.
I’m digging more in the fact that maybe the gnome shell i’m launching through python has a different configuration than the default one. I agree with Sonitck the two configurations may not be the same.
where the last line is where i call the melt video player engine.
The previous lines are meant to load all the configuration the default gnome-terminal has but i guess it lacks some other files or maybe the way i’m invoking is not the correct one: