Is it possible to install pymedia on recent Ubuntu builds? - python

I have all the dependencies for pymedia, but they are all "not found" by the installation script. I see that pymedia is no longer in active development, but just want to see if anyone has been able to install it on Ubuntu 14.04, on a 64-bit machine. I require it for a function in pyschopy.

Given that pymedia hasn't been touched for 9 years I think you'll be struggling to build it. Is the aim to build a movie from some frames? I'd suggest outputting them from PsychoPy as png images and then combining them with ffmpeg.
I intend in the future to add support back in to output movie files directly using pymovie to combine the frames (which uses ffmpeg in the background), but this isn't on the top of the priorities list! ;-)

Related

Using webcam as a QR code scanner in Python-3.6

I have spent weeks looking for a way to turn my webcam (built into the computer) into a QR scanner using Python but nothing has worked.
In the first instance, I tried installing this software which supposedly would allow me to turn my camera into a barcode scanner, which could then use this video to decode the codes in python. I installed the scanner along with 'pywin32' which was supposedly the library I needed to use, but I couldn't get the two to communicate as my computer kept saying that pywin32 has not been installed (although it had).
Then, I moved onto using zbar/ pyzbar. I downloaded all of the modules that were recommended (I followed the instructions set out on here) but these each came with several more error messages. It was all to do with various libraries and modules not being installed - I've tried downloading PIL/pillow, pyqrcode and a number of other things that are supposed to work, but for some reason, don't.
I don't feel that I can provide any evidence of code as I haven't got any code to fix for this particular issue -- I am simply looking for anyone who may know of a way to transform an ordinary webcam into a barcode/qr scanner using python.
Assuming none of the libraries I need are installed on my computer at the moment, could someone please explain to me exactly which libraries I will need to download, where I can find them, and how I could use them to make Python communicate with my webcam?
This is for my A Level Coursework and the scanner is absolutely fundamental to the program; if anyone can provide me with a useful, understandable solution then I would be really grateful. I apologise if this question is still a little too broad - I am a complete novice to coding and after searching endlessly for hours to find a solution, I feel that this is my final resort.
I did a project on zbar a couple of years ago, and it took 6 months to get zbar working :)
Here's how I setup zbar:
Zbar python module does require zbar.exe. Go to http://zbar.sourceforge.net/download.html and click either ZBar 0.10 Windows installer if you have windows, or Linux builds. Run zbar-0.10-setup.exe and follow installation instructions.
The Zbar python module is available on pypi. That means a simple pip install zbar will install it.
To get .py examples of Zbar running, first download the source code for zbar (top link on http://zbar.sourceforge.net/download.html ), unzip the tar.bz2 file (use 7zip). Inside the unzipped folder there should be /examples. Inside the folder, you will find several examples (proccessor.py is a good one), which can be run just as you would normally run a python program.

Application file with Python and FFMPEG

Not sure if this is the right place for this question - but I have a python script which uses ffmpeg. I want to create an application/executable file which includes the dependencies of Python and ffmpeg which I can distribute so that others don't have to install Python or ffmpeg on their machine to run the script.
Any ideas how this can be achieved?
I don't know whether my answer will be sufficient, but I hope it may lead to the answer.
First, FFMPEG is not a problem, it's very independent, needs no installation. However, I know nothing of Python nor do I know your target machines, the target operating systems.
There's a very popular online video downloader developed under Python (which can also use FFMPEG) called: youtube-dl. This runs independently under Windows without any additional installations. Maybe worth checking out?
youtube-dl link here: youtube-dl

How to make my python 3 desktop application portable?

I have tried portable python but the latest version is 3.2.5. (need 3.6+)
I cannot install libraries on it, even the get-pip.py doesn't work.
I'm trying to figure out how to make my project portable on windows systems that do not have python installed.
Also I want the minimum possible libraries(core python modules) to keep the project as lean as possible,
I would go with cx_Freeze - multiplatform module for freezing your Python script in a way that allows you to open it on other Windows machines even if they do not have Python installed. It got very nice and clear documentation also: http://cx-freeze.readthedocs.io/en/latest/ and works a bit better on Windows machines then alternative PyInstaller from my experience (which has interesting option of one-file-package, but in many cases leads to security warnings due to some dirty hacks used to obtain that feature).
However, it may not be enough if you are using some specific modules in your app, as for example matplotlib, dash, etc modules are very hard to pack correctly with Freezer.
I have found a solution to my own question after a couple of days.
I did not want to create an executable for my project but I wanted a portable python folder so that I can add libraries to it as and when I need.
The recent version of portable python is WinPython.
I had to delete some unnecessary files out of it though.
It's size is about 77 mb after extracting
https://winpython.github.io/
https://sourceforge.net/projects/winpython/files/WinPython_3.6/3.6.5.0/WinPython64-3.6.5.0Zero.exe/download

Setting up CMUSphinx/PocketSphinx on Windows 7

I have been trying this for hours now, but cannot seem to get this right. I am trying to download Pocketsphinx for use of command recognition in Python.
So first thing I did was attempt to install SphinxBase, which is required for Pocketsphinx to work. So here we go. I downloaded the files, the tar.gz zip. I followed the instructions in the README document in order to install on windows.
To compile sphinxbase in Visual Studio 2010 Express (or newer):
1, unzip the file.
2, rename the directory to sphinxbase
3, go into the sphinxbase folder and click sphinxbase.sln
4, in the menu, choose Build -> Rebuild All -> Batch Build -> Build
I have never used visual before, but it seemed pretty self explanatory. First thing I did was unzip and rename. Next up I opened the SLN project in visual, selected all 6 projects, the Files>Build Selection. It build with all 6 projects succeeding. Great, that's done. Now was that really all? I had to do?
Next up was PocketSphinx. I downloaded the tar.gz again, and basically did the same process.
* load pocketsphinx.sln in pocketsphinx directory
* compile all the projects in PocketSphinx
All builds succeeded in being built. So... done, right? After this, I am lost. Most tutorials stop here and do not actually go into using Pocketsphinx in other languages. I need to be able to use it in Python.
So I did some digging around and found a setup_win32.py file under pocketsphinx/python. I tried to run this in the command prompt but go multiple errors. Now I am running windows 64 bit, but could this cause this issue?
http://hastebin.com/japobecusi.tex
So all in all, I just need help getting this to work with Python. I am very inexperienced in these things currently. Thanks
One more thing, I am considering switching to my Ubuntu Linux partition in order to almost make it easier on myself. Most programs, including this one, seem to only use windows 32, like 64 is unacceptable apparently. So would it benefit me to move over to a Linux platform to work in Python? Would it be easier?
Thanks for any help in advance.
It is not that trivial to build python with swig on windows. You can just pick latest prebuilt binaries here:
https://pypi.python.org/pypi/PyPocketSphinx/12608
At the corresponding repository https://github.com/bambocher/PyPocketSphinx you can find more detailed manual on how to build it.
Please note that for latest features you need a latest pocketsphinx version from github/subversion repository, a packaged 0.8 is not going to work.
Switch to Linux is also a good idea.

python gstreamer for windows

I want to use Python bindings for GStreamer on windows. But looking at the INSTALL file, the gstreamer does it in the unix way. (make make install) . I don't want to install cygwin or other windowsunix environments.
Is there a GPL binary distribution of GStreamer available somewhere? (or a script that can just install it using python setup.py install)
thanks
UPDATE: I am using Python 2.6 (or higher). The current packages are only available for Python 2.4 or 2.5
I will answer my own question.
Found this link GStreamer WinBuilds that has a binary available for Python Gestreamer ( Python2.6) http://www.gstreamer-winbuild.ylatuya.es/doku.php?id=download#developers_files
I know this post is old, however I am still going to post these resources as they are great for easy install of gstreamer and python with detailed video and text documentation to follow. There is not much simple step-by-step out there to get up and running, but this did it for me on windows with python, which was the original intent of this question.
Here is the video resource:
Video Streaming Made Awesome with GStreamer and Python - sunhacks 2020 Talk
And the text based version that goes with it for links and references
Sunhacks Gstreamer 2020 Talk

Categories

Resources