hey guys I am trying to make the django-video-encoding package work with my code, but it doesn't seem to be converting the videos. I have followed exactly as per the documentation. Can someone help with checking the code I have if I missed anything??
This is the link to the package: https://github.com/escaped/django-video-encoding
Can anyone tell me where I went wrong? I couldn't see any tutorials or much info regarding this package but it seems like its the only one there.
I have given the path to ffmpeg like this (am not sure whether its the right way to provide path). this is in settings.
VIDEO_ENCODING_FFMPEG_PATH = "c:\\ffmpeg\\bin\\ffmpeg.exe"
in my signals.py I have this.
#receiver(post_save, sender=VideoPost)
def convert_video(sender, instance, **kwargs):
enqueue(tasks.convert_all_videos, instance._meta.app_label, instance._meta.model_name, instance.pk)
print('Done converting!')
and this prints after I upload a video, but the conversion does not happen.
I tried to recreate but everything seems smooth to me. I didn't point the ffmpeg location though as I set it up in the PATH instead. Try to to set the ffmpeg as global(system) variable instead.
Related
For a business process discovery task, I am trying to generate a process model, following pm4py python library. Here's a sample code:
!pip install pm4py
import pm4py
log = pm4py.read_xes('/content/running-example.xes')
process_model, initial_marking, final_marking = pm4py.discover_petri_net_inductive(log)
pm4py.view_petri_net(process_model, initial_marking, final_marking, format="svg")
However, I get output as:
parsing log, completed traces :: 100%
6/6 [00:00<00:00, 121.77it/s]
But no image as is expected from the website: https://pm4py.fit.fraunhofer.de/getting-started-page#discovery
Being relatively new to the world of python, what I learnt from other coders' suggestions here on SO that always read in depth the source code in case of open source libraries.
Here is pm4py visual links:
https://github.com/pm4py/pm4py-core/blob/afee8b0932283b8f8f02dd2b6cc0968a1f1cc723/pm4py/visualization/process_tree/visualizer.py#L69
and specifically for my example:
https://github.com/pm4py/pm4py-core/blob/afee8b0932283b8f8f02dd2b6cc0968a1f1cc723/pm4py/vis.py#L17
But I am not able to figure out how to manipulate it.
Can someone please point out the problem to me and help me generate the views. Also, if anyone has done business process generations before, maybe if you could suggest me any libraries or techniques to analyse event-logs data it would be really helpful.
to visualize the process models mined in PM4Py, make sure that you have graphviz installed on your computer.
see https://pm4py.fit.fraunhofer.de/install for more information on this.
I created a very customized leaflet map on a Bitrix website (they forced me to, not my choice). Now other coworkers who are basically "afraid" of code need to be able to add markers to that. I already created a C++ program where they can simply enter all the details they want (what category, whats the popupcontent etc.) and it spits out the geoJSON code for the marker for them to copy and paste into the website.
To make it even more easy for them I am wondering if there is a way to basically have my program connect to the internet, go to the backend of my website and, after asking for login, adds the code to the respective .js file that contains only the marker code.
I have been googling the problem but unfortunately couldnt find any other related posts.
Okay I finally found the I guess easiest way, I will force my colleagues to install python and write a little thingy to concatenate the code and upload it using Selenium. Thanks for your help guys!
I am currently trying to deploy a python(2.7) application on the GAE, but I seem to have run into a wall doing so.
In the application I need to apply some transformations on an image's data which I have retrieved in the form of an array of bytes. I proceeded as pointed out by the OP of this question. Everything seems to go fine, until I wish to retrieve back the image's data from the PIL.Image object. The code is:
def transform_image(im_data,ratio):
im = Image.open(BytesIO(im_data))
w,h = im.size
im = im.crop((0,0,w,h-20))
new_b_io = BytesIO()
im.save(new_b_io,format='JPEG')
im.close()
return new_b_io.getvalue()
#I write this data to a new '.jpg' file on my GCS bucket.
Looking at my GAE application logs, the exception being raised is:
UnsupportedOperation: fileno
This is an identified bug with the PIL version 1.1.7 (the only PIL version available with GAE), as pointed out here.
Looking everywhere, all I could manage to understand is to use a more latest version of PIL (preferably Pillow), but as one would imagine, our friends at Google haven't made that an option. I could move to the Google's Image Processing API, but I'd appreciate if I could make my way through with PIL.
I'd appreciate if someone could walk me through this dilemma.
Thanks for your time.
This is related to the question I posted here, but I hadn't gotten much visibility for that question so I wanted to ask in a more general way. I have a Qt 4.7 project that utilizes QFtp functionality. Until very recently we were using this with an FTP server that was vsftpd. Everything worked fine with it then. However, several days ago we moved the server to a new computer. All the contents are identical, but now it uses pure-ftpd instead of vsftpd. Since the move, none of my QFtp code works properly. Is there any known problems that arise when trying to use QFtp with this type of FTP server? I can't find anything helpful online, and it's rather frustrating not being able to find anything wrong with the code and yet having it not work. If anyone knows anything about this and could please share, I'd appreciate it a lot. Thanks!
So I think I just figured something out... I had it run QFtp::list to go through the ftp and retrieve directories, then use list() again on those to retrieve the files in those subdirectories. Our subdirectories to get files out of had spaces in the name, eg "My Directory". Apparently, the vsftpd we were using before could handle this with no problem, but the pure-ftpd can't handle spaces in the directory names. When I switch it to something like "MyDirectory" or "My_Directory", the pure-ftpd works fine. I couldn't find anything online about this difference, but apparently it's there, because that fixed the issue I was having.
I installed PIL.
I can import PIL (with no error message)
Then I ran the code mentioned here:
Python images display
And I get this error message:
IOError: decoder jpeg not available
I understand this is Library called libjpeg and (?) it should be installed already.
Or is it part of PIL?
Where is it installed if so?
And if not where can I download it?
What I would like to achieve (and seem to run in one problem after the other), would be simply explainable as a Webgallery which I than want to tweak. But first I need Django to get images from the MEDIA_ROOT and display them in the browser when somebody calls a URL. And then I need one button (Next).
And if Christmas and Easter will fall on the same day I want to get the timestamp of that button click.
I thought that would be a breeze. But now I am in a storm of libjpeg and PIL an Tkinter and Models and photologue and ImageField() and.
If anybody has done that (I guess any simple Image display on a Blog) I would be very very glad to hear this expierence.
I somehow cant understand the standard way to do this and every time I think I have the solution, there is some library missing or it is slightly not what I was looking for.
Thanks for the time!
I wrote an article on how to get libjpeg, PIL to work on Snow Leopard.
http://appelfreelance.com/2010/06/libjpeg-pil-snow-leopard-python2-6-_jpeg_resync_to_restart/
Hope you might find this handy
Try this: http://rodesia.org/2008/03/14/installing-pil-on-the-mac/