ass2rythmo


Nameass2rythmo JSON
Version 1.0.0 PyPI version JSON
download
home_page
SummaryGenerate rythmo band from Ass subtitles
upload_time2023-09-11 14:43:21
maintainer
docs_urlNone
author
requires_python>=3.2
licenseGPLv3+
keywords ass rythmo subtitles subs
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Ass2Rythmo
==========

ass2rythmo is a converter which generate rythmo band out of subtitles in ASS (`Advanced SubStation <https://en.wikipedia.org/wiki/SubStation_Alpha#Advanced_SubStation_Alpha>`_) format.

Rythmo bands are used to provide synchronized script for voice actors when dubbing a video.

The text scrolls at a constant speed but has a variable width to adapt to the speech flow that needs to be recorded to be synchronised with lips on screen.

Installation
------------

Ass2Rythmo can be installed from pip::

	pip install ass2rythmo


Alternatively, Ass2Rythmo can be run directly from sources after a git pull::

	git clone https://gitlab.com/zeograd/ass2rythmo.git
	cd ass2rythmo && python setup.py install

Usage
-----

First, generate a timed ASS subtitle file including only the part having to be said by actors.

Then, generate the rythmo band as as collection of transparent png files::

	ass2rythmo my_video_script.ass -R 30

or as a *transparent* movie if you have ffmpeg_ available::

    ass2rythmo my_video_script.ass -R 30 -r rythmo_band.mov

or as *opaque* movie, still with ffmpeg_ available::

    ass2rythmo my_video_script.ass -R 30 -r rythmo_band.mp4

Don't forget to specify the frame rate of the video on which the png will be superposed to ensure a correct synchronisation.

By default, this will generate png file in the current directory named 00000.png, 00001.png, etc...
You can change the directory in which the png files are generated by providing a pattern to the **-r** argument including percent sign
(**/tmp/%05d.png** for instance, for generating png in the **/tmp** directory and padding the frame number on 5 digits.)

If you specify a pattern without any percent sign, it will be considered as a
single movie file output filename.
The result will be encoded with **FFV1** codec and **mov** container if the extension
of the output file is **mov**.

If you use another extension, the default ffmpeg rule will apply. Typically you
may want a **h264** encoded movie in a **mp4** container by asking for an output
filename ending in **mp4**.


Then you can burn the png sequence on top of your movie using your favorite video editor. You can also use **ffmpeg** to perform a quick overlaying, with a command similar to::

	ffmpeg -i input.mp4 -framerate 30 -i %05d.png -filter_complex "overlay=:main_h-overlay_h" output.mp4

to do the same with a transparent mov rythmo band, use something like::

    ffmpeg -i input.mp4 -i rythmo_band.mov -filter_complex "overlay=:main_h-overlay_h" output.mp4


Script creation
---------------

Use any ASS compatible tool, like Aegisub_.

You can use the regular { } to include comments or alternatively [ ] to include content which won't appear in the rythmo band (but still be present if you burn the ass file onto a video, like for actor direction hints).

The bundled font was chosen so that you can include unicode character to show which kind of intonation change you'd like (using unicode arrows).

You can fine tune a single sentence timing using the karaoke tags. You don't have to split your script for the sake of introducing a pause or changing the pace between 2 parts of a sentence.
In this case, you can preview the speed at which every part of your sentence will be rendered using **/kf** instead of the default **/k** tags (both will be accepted by **ass2rythmo**, **/ko** is also working)

Obviously, take care of synchronizing carefully your subtitles with the lips on screen to ensure that recording according to the rythmo band will be synchronized with the images.

You can disable rendering rythmo band for an *actor* by including **[norythmo]** in its name.

CLI
---

The CLI **ass2rythmo** includes sensible default values.
You should be careful about setting the correct frame rate with **-R** option.

You may want to alter the generated width to use fully your available room with **-W** and also change the scroll speed with **-D**.

Other options are less often useful and documented below.


	usage: ass2rythmo [-h] [-d] [-v] [-W TARGET_WIDTH] [-H TARGET_HEIGHT]
	                  [-R TARGET_FPS] [-F FONT_FILENAME] [-D SCROLL_DURATION]
	                  [-r RESULT_FILENAME_FORMAT] [-s SYNC_POINT_RATIO]
	                  ass_filename

	GPL v3+ 2018 Olivier Jolly

	positional arguments:
	  ass_filename          input file as Ass format

	optional arguments:
	  -h, --help            show this help message and exit
	  -d, --debug           print debugging info [default: False]
	  -v, --version         show program's version number and exit
	  -W TARGET_WIDTH, --target_width TARGET_WIDTH
	                        Width of the generated png files [default: 1920]
	  -H TARGET_HEIGHT, --target_height TARGET_HEIGHT
	                        Height of the generated png files. Note that it's not
	                        meant to support low heights at this time [default:
	                        380]
	  -R TARGET_FPS, --target_fps TARGET_FPS
	                        Frame per second to generate. Make sure it matches
	                        your subbed video ! [default: 30]
	  -F FONT_FILENAME, --font_face FONT_FILENAME
	                        Filename of the font used to generate text [default:
	                        [install path]/DejaVuSans.ttf]
	  -D SCROLL_DURATION, --scroll_duration SCROLL_DURATION
	                        Duration of width traversal in ms [default: 4000]
	  -r RESULT_FILENAME_FORMAT, --result_filename_format RESULT_FILENAME_FORMAT
                        Filename template for generated files. May include
                        directory part but won't create any. Including % in
                        the format will generate a list of png files else will
                        generate a transparent movie with the help of ffmpeg
                        [default: %05d.png]
	  -s SYNC_POINT_RATIO, --sync_point_ratio SYNC_POINT_RATIO
	                        Position of the sync point on screen, 0 is leftmost, 1
	                        is rightmost [default: 0.15]

	Convert ASS subtitles to rythmo band as list of transparent png or single transparent movie

LIMITATIONS
-----------

This program is quite young and not extensively tested. Notably, it was only run under linux so far, but no OS specificity were used.

The rendering is done on 2 lines maximum. So with 3 actors speaking at the same time, there will be some overlayed text above each other.

Some artefacts may appear on the leftmost part of short text chunk for some characters (like a "I" to be pronounced very quickly at the beginning of a text chunk).

LICENSE
-------

The ass2rythmo code itself is licensed under GPL V3+ and the bundled DejaVu font is licensed under its own free License (cf LICENCE-dejavu.txt).

.. _Aegisub:  http://aegisub.org
.. _Ffmpeg: http://ffmpeg.org

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "ass2rythmo",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.2",
    "maintainer_email": "",
    "keywords": "ass rythmo subtitles subs",
    "author": "",
    "author_email": "Olivier Jolly <olivier@pcedev.com>",
    "download_url": "https://files.pythonhosted.org/packages/25/d7/b18c4819a3b5db5039dffb4807b196399af53966491bbb13332fbd0bca4d/ass2rythmo-1.0.0.tar.gz",
    "platform": null,
    "description": "Ass2Rythmo\n==========\n\nass2rythmo is a converter which generate rythmo band out of subtitles in ASS (`Advanced SubStation <https://en.wikipedia.org/wiki/SubStation_Alpha#Advanced_SubStation_Alpha>`_) format.\n\nRythmo bands are used to provide synchronized script for voice actors when dubbing a video.\n\nThe text scrolls at a constant speed but has a variable width to adapt to the speech flow that needs to be recorded to be synchronised with lips on screen.\n\nInstallation\n------------\n\nAss2Rythmo can be installed from pip::\n\n\tpip install ass2rythmo\n\n\nAlternatively, Ass2Rythmo can be run directly from sources after a git pull::\n\n\tgit clone https://gitlab.com/zeograd/ass2rythmo.git\n\tcd ass2rythmo && python setup.py install\n\nUsage\n-----\n\nFirst, generate a timed ASS subtitle file including only the part having to be said by actors.\n\nThen, generate the rythmo band as as collection of transparent png files::\n\n\tass2rythmo my_video_script.ass -R 30\n\nor as a *transparent* movie if you have ffmpeg_ available::\n\n    ass2rythmo my_video_script.ass -R 30 -r rythmo_band.mov\n\nor as *opaque* movie, still with ffmpeg_ available::\n\n    ass2rythmo my_video_script.ass -R 30 -r rythmo_band.mp4\n\nDon't forget to specify the frame rate of the video on which the png will be superposed to ensure a correct synchronisation.\n\nBy default, this will generate png file in the current directory named 00000.png, 00001.png, etc...\nYou can change the directory in which the png files are generated by providing a pattern to the **-r** argument including percent sign\n(**/tmp/%05d.png** for instance, for generating png in the **/tmp** directory and padding the frame number on 5 digits.)\n\nIf you specify a pattern without any percent sign, it will be considered as a\nsingle movie file output filename.\nThe result will be encoded with **FFV1** codec and **mov** container if the extension\nof the output file is **mov**.\n\nIf you use another extension, the default ffmpeg rule will apply. Typically you\nmay want a **h264** encoded movie in a **mp4** container by asking for an output\nfilename ending in **mp4**.\n\n\nThen you can burn the png sequence on top of your movie using your favorite video editor. You can also use **ffmpeg** to perform a quick overlaying, with a command similar to::\n\n\tffmpeg -i input.mp4 -framerate 30 -i %05d.png -filter_complex \"overlay=:main_h-overlay_h\" output.mp4\n\nto do the same with a transparent mov rythmo band, use something like::\n\n    ffmpeg -i input.mp4 -i rythmo_band.mov -filter_complex \"overlay=:main_h-overlay_h\" output.mp4\n\n\nScript creation\n---------------\n\nUse any ASS compatible tool, like Aegisub_.\n\nYou can use the regular { } to include comments or alternatively [ ] to include content which won't appear in the rythmo band (but still be present if you burn the ass file onto a video, like for actor direction hints).\n\nThe bundled font was chosen so that you can include unicode character to show which kind of intonation change you'd like (using unicode arrows).\n\nYou can fine tune a single sentence timing using the karaoke tags. You don't have to split your script for the sake of introducing a pause or changing the pace between 2 parts of a sentence.\nIn this case, you can preview the speed at which every part of your sentence will be rendered using **/kf** instead of the default **/k** tags (both will be accepted by **ass2rythmo**, **/ko** is also working)\n\nObviously, take care of synchronizing carefully your subtitles with the lips on screen to ensure that recording according to the rythmo band will be synchronized with the images.\n\nYou can disable rendering rythmo band for an *actor* by including **[norythmo]** in its name.\n\nCLI\n---\n\nThe CLI **ass2rythmo** includes sensible default values.\nYou should be careful about setting the correct frame rate with **-R** option.\n\nYou may want to alter the generated width to use fully your available room with **-W** and also change the scroll speed with **-D**.\n\nOther options are less often useful and documented below.\n\n\n\tusage: ass2rythmo [-h] [-d] [-v] [-W TARGET_WIDTH] [-H TARGET_HEIGHT]\n\t                  [-R TARGET_FPS] [-F FONT_FILENAME] [-D SCROLL_DURATION]\n\t                  [-r RESULT_FILENAME_FORMAT] [-s SYNC_POINT_RATIO]\n\t                  ass_filename\n\n\tGPL v3+ 2018 Olivier Jolly\n\n\tpositional arguments:\n\t  ass_filename          input file as Ass format\n\n\toptional arguments:\n\t  -h, --help            show this help message and exit\n\t  -d, --debug           print debugging info [default: False]\n\t  -v, --version         show program's version number and exit\n\t  -W TARGET_WIDTH, --target_width TARGET_WIDTH\n\t                        Width of the generated png files [default: 1920]\n\t  -H TARGET_HEIGHT, --target_height TARGET_HEIGHT\n\t                        Height of the generated png files. Note that it's not\n\t                        meant to support low heights at this time [default:\n\t                        380]\n\t  -R TARGET_FPS, --target_fps TARGET_FPS\n\t                        Frame per second to generate. Make sure it matches\n\t                        your subbed video ! [default: 30]\n\t  -F FONT_FILENAME, --font_face FONT_FILENAME\n\t                        Filename of the font used to generate text [default:\n\t                        [install path]/DejaVuSans.ttf]\n\t  -D SCROLL_DURATION, --scroll_duration SCROLL_DURATION\n\t                        Duration of width traversal in ms [default: 4000]\n\t  -r RESULT_FILENAME_FORMAT, --result_filename_format RESULT_FILENAME_FORMAT\n                        Filename template for generated files. May include\n                        directory part but won't create any. Including % in\n                        the format will generate a list of png files else will\n                        generate a transparent movie with the help of ffmpeg\n                        [default: %05d.png]\n\t  -s SYNC_POINT_RATIO, --sync_point_ratio SYNC_POINT_RATIO\n\t                        Position of the sync point on screen, 0 is leftmost, 1\n\t                        is rightmost [default: 0.15]\n\n\tConvert ASS subtitles to rythmo band as list of transparent png or single transparent movie\n\nLIMITATIONS\n-----------\n\nThis program is quite young and not extensively tested. Notably, it was only run under linux so far, but no OS specificity were used.\n\nThe rendering is done on 2 lines maximum. So with 3 actors speaking at the same time, there will be some overlayed text above each other.\n\nSome artefacts may appear on the leftmost part of short text chunk for some characters (like a \"I\" to be pronounced very quickly at the beginning of a text chunk).\n\nLICENSE\n-------\n\nThe ass2rythmo code itself is licensed under GPL V3+ and the bundled DejaVu font is licensed under its own free License (cf LICENCE-dejavu.txt).\n\n.. _Aegisub:  http://aegisub.org\n.. _Ffmpeg: http://ffmpeg.org\n",
    "bugtrack_url": null,
    "license": "GPLv3+",
    "summary": "Generate rythmo band from Ass subtitles",
    "version": "1.0.0",
    "project_urls": {
        "Bug Tracker": "https://gitlab.com/zeograd/ass2rythmo/-/issues",
        "Homepage": "https://gitlab.com/zeograd/ass2rythmo"
    },
    "split_keywords": [
        "ass",
        "rythmo",
        "subtitles",
        "subs"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c617791e4112fe43a4ec116e95e1fac75fae4727a9bc769ee9cc334589051937",
                "md5": "1edf9de252f4ec69ffd7b382eb0eba44",
                "sha256": "f07e83bfc4d03ae7ebabf1e4ef6a6fa3e0619a28be28ea1e7fd6f83a970097dc"
            },
            "downloads": -1,
            "filename": "ass2rythmo-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1edf9de252f4ec69ffd7b382eb0eba44",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.2",
            "size": 404627,
            "upload_time": "2023-09-11T14:43:15",
            "upload_time_iso_8601": "2023-09-11T14:43:15.226432Z",
            "url": "https://files.pythonhosted.org/packages/c6/17/791e4112fe43a4ec116e95e1fac75fae4727a9bc769ee9cc334589051937/ass2rythmo-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "25d7b18c4819a3b5db5039dffb4807b196399af53966491bbb13332fbd0bca4d",
                "md5": "1ba9952cbc24a87130d7cdb9f8177c96",
                "sha256": "17c2c05192fae40e652d1fcd6bd20715d3d5bb5f5e86afd8c124f802644c21cd"
            },
            "downloads": -1,
            "filename": "ass2rythmo-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1ba9952cbc24a87130d7cdb9f8177c96",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.2",
            "size": 404569,
            "upload_time": "2023-09-11T14:43:21",
            "upload_time_iso_8601": "2023-09-11T14:43:21.440653Z",
            "url": "https://files.pythonhosted.org/packages/25/d7/b18c4819a3b5db5039dffb4807b196399af53966491bbb13332fbd0bca4d/ass2rythmo-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-11 14:43:21",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "zeograd",
    "gitlab_project": "ass2rythmo",
    "lcname": "ass2rythmo"
}
        
Elapsed time: 0.11162s