Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Merge video with subtitles
#14
Finally, I found a "pure-Python" solution to embed subtitles.
It's based on using MoviePy package.
Here is example how to proceed:
MoviePy example

When I tried this example, error occurred:
Output:
=========== RESTART: /home/pavel/python_code/embed_subtitles_v1.py =========== Traceback (most recent call last): File "/home/pavel/.local/lib/python3.6/site-packages/moviepy/video/VideoClip.py", line 1137, in __init__ subprocess_call(cmd, logger=None) File "/home/pavel/.local/lib/python3.6/site-packages/moviepy/tools.py", line 54, in subprocess_call raise IOError(err.decode('utf8')) OSError: convert-im6.q16: not authorized `@/tmp/tmpsw5kqzya.txt' @ error/property.c/InterpretImageProperties/3516. convert-im6.q16: no images defined `PNG32:/tmp/tmpxp1zmiyb.png' @ error/convert.c/ConvertImageCommand/3258. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pavel/python_code/embed_subtitles_v1.py", line 14, in <module> subtitles = SubtitlesClip(subtl_in, generator) File "/home/pavel/.local/lib/python3.6/site-packages/moviepy/video/tools/subtitles.py", line 86, in __init__ hasmask = bool(self.make_textclip('T').mask) File "/home/pavel/python_code/embed_subtitles_v1.py", line 13, in <lambda> generator = lambda txt: TextClip(txt, font='Arial', fontsize=20, color='yellow') File "/home/pavel/.local/lib/python3.6/site-packages/moviepy/video/VideoClip.py", line 1146, in __init__ raise IOError(error) OSError: MoviePy Error: creation of None failed because of the following error: convert-im6.q16: not authorized `@/tmp/tmpsw5kqzya.txt' @ error/property.c/InterpretImageProperties/3516. convert-im6.q16: no images defined `PNG32:/tmp/tmpxp1zmiyb.png' @ error/convert.c/ConvertImageCommand/3258. . .This error can be due to the fact that ImageMagick is not installed on your computer, or (for Windows users) that you didn't specify the path to the ImageMagick binary in file conf.py, or that the path you specified is incorrect >>>
I've checked if ImageMagick is installed.
It's the case, ImageMagick is here.

Any suggestions ?
Thanks.
Reply


Messages In This Thread
Merge video with subtitles - by Pavel_47 - Jun-26-2022, 10:57 AM
RE: Merge video with subtitles - by snippsat - Jun-26-2022, 11:51 AM
RE: Merge video with subtitles - by Pavel_47 - Jun-26-2022, 01:28 PM
RE: Merge video with subtitles - by snippsat - Jun-26-2022, 02:26 PM
RE: Merge video with subtitles - by Pavel_47 - Jun-26-2022, 05:07 PM
RE: Merge video with subtitles - by Pavel_47 - Jun-28-2022, 10:18 AM
RE: Merge video with subtitles - by Axel_Erfurt - Jun-28-2022, 02:12 PM
RE: Merge video with subtitles - by Pavel_47 - Jun-28-2022, 03:03 PM
RE: Merge video with subtitles - by snippsat - Jun-28-2022, 02:48 PM
RE: Merge video with subtitles - by Pavel_47 - Jun-28-2022, 03:18 PM
RE: Merge video with subtitles - by Pavel_47 - Jul-04-2022, 09:42 AM
RE: Merge video with subtitles - by Pavel_47 - Jun-28-2022, 03:34 PM
RE: Merge video with subtitles - by snippsat - Jun-29-2022, 01:29 AM
RE: Merge video with subtitles - by Pavel_47 - Jul-03-2022, 09:44 AM
RE: Merge video with subtitles - by Pavel_47 - Jul-03-2022, 10:03 AM
RE: Merge video with subtitles - by snippsat - Jul-04-2022, 10:33 AM
RE: Merge video with subtitles - by Pavel_47 - Jul-04-2022, 11:30 AM
RE: Merge video with subtitles - by Pavel_47 - Jul-04-2022, 11:32 AM
RE: Merge video with subtitles - by snippsat - Jul-04-2022, 12:02 PM
RE: Merge video with subtitles - by Pavel_47 - Jul-06-2022, 01:26 PM
RE: Merge video with subtitles - by Pavel_47 - Jul-04-2022, 12:45 PM
RE: Merge video with subtitles - by snippsat - Jul-04-2022, 01:04 PM
RE: Merge video with subtitles - by Pavel_47 - Jul-04-2022, 01:31 PM
RE: Merge video with subtitles - by snippsat - Jul-04-2022, 08:07 PM
RE: Merge video with subtitles - by snippsat - Jul-06-2022, 01:54 PM
RE: Merge video with subtitles - by Pavel_47 - Jul-06-2022, 02:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to 'soft-embedd' subtitles with python-ffmpeg Pavel_47 2 2,240 Jul-04-2022, 12:33 PM
Last Post: Pavel_47

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020