I'm working on MoviePy to burn subtitles into video. Using TextClip
subData = processSrtFormatData(request.json['subData'])
subtitles = SubtitlesClip(subData, styleForText)
def styleForText(txt):
return TextClip(txt, font='Arial', fontsize=12, color='white')
and when deploy to Heroku. It throws error like in image below
IMG_URL: https://i.ibb.co/0DLMvtc/Untitled.png
I tried to use different buildpacks on Heroku, include:
https://github.com/DuckyTeam/heroku-buildpack-imagemagick
https://github.com/ello/heroku-buildpack-imagemagick
But only
https://github.com/ello/heroku-buildpack-imagemagick
works.
The problem is the 'ello' use imagemagick 6.9 and failed to work with unicode (as shown here). However on local run with imagemagick 7.1, it worked perfectly.
My question is how can I set the buildpack 7.1 on heroku or is there any other way to work with my MoviePy TextClip on unicode
IMG_URL: https://i.ibb.co/xHNmGcz/Untitledsd.png
Many thanks! (sorry for the images, dont have 10 reputation to include inside the question)
Related
I would like to use FFMPEG for my bot that I want to host on Heroku. For this I installed the following buildpack: https://elements.heroku.com/buildpacks/jonathanong/heroku-buildpack-ffmpeg-latest.
I added some checks in my source code to check the FFMPEG path:
source = discord.PCMVolumeTransformer(
discord.FFmpegPCMAudio(song.stream_url, executable=FFMPEG_PATH, before_options=beforeArgs),
volume=state.volume)
and the path is:
FFMPEG_PATH = parser.get('MUSIC', 'ffmpeg-path')
In a config file I then have the following:
ffmpeg-path : /usr/bin/ffmpeg
But this does not seem to be the correct path. So how do I get the path of the buildpack at Heroku?
To get the FFMPEG working on Heroku you have to install the following packs:
https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest - FFMPEG.
https://github.com/xrisk/heroku-opus - Avoids OpusNotLoaded() errors.
You can add them under Settings/Buildpacks.
The default path, if needed, is ffmpeg.
You can then launch the bot.
I am making videos with moviepy. Created locally, the final videofile has audio. When I run the same code on heroku, the final video has no audio.
First, I thought not using the /tmp directory on heroku might be the issue. I also followed advice to add audio parameters to write_videofile. Both didn't solve the problem.
I am using the heroku ffmpeg buildpack.
#Make soundtrack
soundtrack = AudioFileClip('https://storage.googleapis.com/ABC/music.mp3')
soundtrack = soundtrack.set_duration(final_clip.duration)
#Add soundtrack
final_clip = final_clip.set_audio(soundtrack)
#Write videofile
final_clip.write_videofile('tmp/video/combined_movie.mp4',
codec='libx264',
audio_codec='aac',
temp_audiofile='tmp/video/soundtrack-temp-audio.m4a',
remove_temp=False,
fps=10)
#Storing on google cloud
try:
upload_blob('ABC','tmp/video/combined_movie.mp4','tmp/video/combined_movie.mp4')
except:
print('error when uploading final video file to google storage.')
In the console is see:
Moviepy - Building video tmp/video/combined_movie.mp4.
MoviePy - Writing audio in %s
MoviePy - Done.
Moviepy - Writing video tmp/video/combined_movie.mp4
Moviepy - Done !
Moviepy - video ready tmp/video/combined_movie.mp4
Google Cloud Storage upload successful.
Help is appreciated!
Found a solution!
I forked the same buildpack and changed the DOWNLOAD variable to ffmpeg version 4.1.3 (same version installed on my localhost).
Just run this command on your terminal:
heroku buildpacks:add https://github.com/merwane/heroku-buildpack-ffmpeg-latest.git
When I package my Shoes App for Windows images doesn't work. I have this very simple app (min_test.rb):
Shoes.app()
{
background "bg.jpg"
}
Which works fine if I run it through Shoes, but when I package it with Shoes so that I get a standalone .exe file the images doesn't load. Inside the folder these are the contents:
min_test.rb
bg.jpg
min_test.exe (after packaging)
If Shoes3.3.1, indeed, on linux too.
console (alt-/) saying "couldn't find tmp.....bg.jpg" ?
(background or image)
could you file a bug report, please : https://github.com/Shoes3/shoes3/issues
EDIT: Sorry, wait
if Shoes3.3.1 !
you have to first make a shy then an exe and the resulting exe will be outside of the directory where your script and image is.
follow this : https://github.com/Shoes3/shoes3/wiki/Packaging
(note: tested on linux and on Windows)
Symptom...
docpad run results in the usual messages but it never gets past:
Currently on writeFiles at 45/45 100% =================================================
Environment -
osx 10.8.3
node v0.10.0
npm i.2.14
docpad 6.34.2
ImageMagick v6.8.5-3, which has been confirmed working from the command line
Steps to reproduce...
Install kitchensink skeleton (or the jade and adapt the coffeekup code in example)
Install docpad-plugin-associatedfiles
and docpad-plugin-thumbnails
Create an associate-files directory in Files and drop in another directory called 'gallery' with some .jpg's with no spaces in the filenames
Create a new page called gallery.html.coffee and cut and paste the coffeeKup example from thumbnails' read me file :) - see below.. [I've also tried simplifying it down to the bare functionality to show the thumbnails, by cutting out the checks on file-types and the links to the original sized images.]
docpad run and watch whilst it doesn't finish...
Observations -
If you remove the reference to getThumbnails and just list the associated files it all works peachy.
Filenames for the thumbnails that would be generated show up in the generated HTML file - but the thumbnails do not show up in the out directory (or anywhere else as far as I could find)
So questions...
am I missing the startlingly obvious? (here's hoping)
how do I inspect docpad.log?
I read the instructions for debugging, but so far I've not made sense of them enough to step into any code - sorry - I'm a real novice.
Thanks for any input,
The page looks like this:
---
layout: default
title: Gallery
---
image_exts = ['jpg', 'JPG', 'jpeg', 'JPEG', 'png', 'PNG']
images = #getDocument().getAssociatedFiles().findAll({extension: $in: image_exts}).toJSON()
for image in images
a href: image.url, -> img src: #getThumbnail(image.url, w: 100, h: 100), alt: image.name
I had the same problem, and I used the command:
$ docpad --debug 7 run
If you get the error "spawn ENOENT", you must install graphicsmagick, because the gm library needs some configuration if you use imagemagick.
You can try this command:
npm install --save docpad-plugin-thumbnails
I was facing the similar issue and it worked for me.. hope this helps!
Did you configure the plugin to use imageMagick in your docpad.coffee?
plugins:
thumbnails:
imageMagick: true
We are currently working on an web application testing using Selenium-Webdriver with Ruby. Originally we only test the OSX platform, until recently we realize that Windows platform should also be tested, (IE, Firefox, Chrome, Opera). But those following lines code that work well on OSX fails on Windows(7 & 8).
I want to upload a zip file from relative directory on Windows, like "./assets/application/www.zip"
#driver.execute_script("arguments[0].style.visibility = 'visible'; arguments[0].style.width = '1px';arguments[0].style.height = '1px';arguments[0].style.opacity = 1",upload_a_zip_btn)
upload_a_zip_btn.send_keys (File.expand_path("../../assets/application/www.zip",__FILE__)) # 1
upload_a_zip_btn.send_keys ("assets\/application\/www.zip") # 2
upload_a_zip_btn.send_keys "C:\\www.zip" # 3
I tried all the 3 conditions, but only the 3rd works.
The error appeared in Browser said some error like "no attached file"
Does anyone know how to deal with such situation? Thanks